gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r32637 - gnunet/src/mesh
Date: Thu, 13 Mar 2014 16:01:42 +0100

Author: bartpolot
Date: 2014-03-13 16:01:42 +0100 (Thu, 13 Mar 2014)
New Revision: 32637

Modified:
   gnunet/src/mesh/mesh_profiler.c
Log:
-add info about traffic

Modified: gnunet/src/mesh/mesh_profiler.c
===================================================================
--- gnunet/src/mesh/mesh_profiler.c     2014-03-13 15:01:42 UTC (rev 32636)
+++ gnunet/src/mesh/mesh_profiler.c     2014-03-13 15:01:42 UTC (rev 32637)
@@ -184,7 +184,22 @@
   return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, rnd);
 }
 
+
 /**
+ * Get the index of a peer in the peers array.
+ *
+ * @param peer Peer whose index to get.
+ *
+ * @return Index of peer in peers.
+ */
+static unsigned int
+get_index (struct MeshPeer *peer)
+{
+  return peer - peers;
+}
+
+
+/**
  * Show the results of the test (banwidth acheived) and log them to GAUGER
  */
 static void
@@ -566,7 +581,8 @@
 ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct MeshPeer *peer = (struct MeshPeer *) cls;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending data initializer...\n");
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u -> %u\n",
+              get_index (peer), peer->dest);
 
   GNUNET_MESH_notify_transmit_ready (peer->ch, GNUNET_NO,
                                      GNUNET_TIME_UNIT_FOREVER_REL,
@@ -608,7 +624,7 @@
     peers[i].ch = GNUNET_MESH_channel_create (peers[i].mesh, NULL,
                                               &peers[peers[i].dest].id,
                                               1, flags);
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u -> %u\n", i, peers[i].dest);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u => %u\n", i, peers[i].dest);
     peers[i].ping_task = GNUNET_SCHEDULER_add_delayed (delay_ms_rnd(2000),
                                                        &ping, &peers[i]);
   }




reply via email to

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