gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r24251 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r24251 - gnunet/src/mesh
Date: Wed, 10 Oct 2012 12:26:08 +0200

Author: bartpolot
Date: 2012-10-10 12:26:08 +0200 (Wed, 10 Oct 2012)
New Revision: 24251

Modified:
   gnunet/src/mesh/test_mesh_small.c
Log:
- fix crashes on backwards tests, doxygen, cleanup

Modified: gnunet/src/mesh/test_mesh_small.c
===================================================================
--- gnunet/src/mesh/test_mesh_small.c   2012-10-10 09:38:50 UTC (rev 24250)
+++ gnunet/src/mesh/test_mesh_small.c   2012-10-10 10:26:08 UTC (rev 24251)
@@ -186,6 +186,9 @@
  */
 static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
 
+/**
+ * Filename of the file containing the topology.
+ */
 static char *topology_file;
 
 /**
@@ -233,12 +236,16 @@
  */
 static struct GNUNET_MESH_Tunnel *incoming_t2;
 
-static GNUNET_PEER_Id pid1;
-
+/**
+ * Time we started the data transmission (after tunnel has been established
+ * and initilized).
+ */
 static struct GNUNET_TIME_Absolute start_time;
 
 
-
+/**
+ * Show the results of the test (banwidth acheived) and log them to GAUGER
+ */
 static void
 show_end_data (void)
 {
@@ -262,6 +269,9 @@
 
 /**
  * Check whether peers successfully shut down.
+ * 
+ * @param cls Closure (unused).
+ * @param emsg Error message.
  */
 static void
 shutdown_callback (void *cls, const char *emsg)
@@ -287,6 +297,9 @@
 
 /**
  * Shut down peergroup, clean up.
+ * 
+ * @param cls Closure (unused).
+ * @param tc Task Context.
  */
 static void
 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
@@ -326,6 +339,9 @@
 
 /**
  * Disconnect from mesh services af all peers, call shutdown.
+ * 
+ * @param cls Closure (unused).
+ * @param tc Task Context.
  */
 static void
 disconnect_mesh_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext 
*tc)
@@ -363,9 +379,26 @@
   }
 }
 
+
+/**
+ * Transmit ready callback.
+ * 
+ * @param cls Closure (peer #).
+ * @param size Size of the tranmist buffer.
+ * @param buf Pointer to the beginning of the buffer.
+ * 
+ * @return Number of bytes written to buf.
+ */
 static size_t
 tmt_rdy (void *cls, size_t size, void *buf);
 
+
+/**
+ * Task to schedule a new data transmission.
+ * 
+ * @param cls Closure (peer #).
+ * @param tc Task Context.
+ */
 static void
 data_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
@@ -413,6 +446,7 @@
   }
 }
 
+
 /**
  * Transmit ready callback
  *
@@ -434,7 +468,7 @@
   if (test == SPEED)
   {
     data_sent++;
-    if (data_sent < TOTAL_PACKETS)
+    if (data_sent < TOTAL_PACKETS && ok > 1)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               " Scheduling %d packet\n", data_sent);
@@ -695,16 +729,9 @@
     case UNICAST:
     case SPEED:
     case SPEED_ACK:
-      if (GNUNET_YES == test_backwards)
-      {
-        dest = &d1->id;
-        tunnel = incoming_t;
-      }
-      else
-      {
-        dest = &d2->id;
-        tunnel = t;
-      }
+      // incoming_t is NULL unless we send a relevant data packet
+      dest = &d2->id;
+      tunnel = t;
       break;
     case MULTICAST:
       peers_in_tunnel++;
@@ -884,7 +911,6 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Peer looking: %s\n",
               GNUNET_i2s (&d1->id));
-  pid1 = GNUNET_PEER_intern (&d1->id);
 
   GNUNET_SCHEDULER_add_now (&connect_mesh_service, NULL);
   disconnect_task =




reply via email to

[Prev in Thread] Current Thread [Next in Thread]