- fix peer to notify
[oweals/gnunet.git] / src / mesh / test_mesh_small.c
index 728aae243f8efc5feaa342d53ba587b2016066f7..20b5c27175b40e70ae5f695175fa065e2fe69922 100644 (file)
@@ -515,8 +515,6 @@ data_callback (void *cls, struct GNUNET_MESH_Channel *channel,
 }
 
 
-
-
 /**
  * Stats callback. Finish the stats testbed operation and when all stats have
  * been iterated, shutdown the test.
@@ -556,16 +554,17 @@ stats_iterator (void *cls, const struct GNUNET_TESTBED_Peer *peer,
                 const char *subsystem, const char *name,
                 uint64_t value, int is_persistent)
 {
+  static const char *s_sent = "# keepalives sent";
+  static const char *s_recv = "# keepalives received";
+  uint32_t i;
+
+  i = GNUNET_TESTBED_get_index (peer);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  %u - %s [%s]: %llu\n",
-              cls, subsystem, name, value);
-  if (0 == strncmp("# keepalives sent", name,
-                   strlen("# keepalives sent"))
-      && 0 == (long) cls)
+              i, subsystem, name, value);
+  if (0 == strncmp (s_sent, name, strlen (s_sent)) && 0 == i)
     ka_sent = value;
 
-  if (0 == strncmp("# keepalives received", name,
-                   strlen ("# keepalives received"))
-      && 4 == (long) cls)
+  if (0 == strncmp(s_recv, name, strlen (s_recv)) && 4 == i)
   {
     ka_received = value;
     GNUNET_log (GNUNET_ERROR_TYPE_INFO, " sent: %u, received: %u\n",
@@ -834,7 +833,7 @@ int
 main (int argc, char *argv[])
 {
   initialized = GNUNET_NO;
-  uint32_t ports[2];
+  static uint32_t ports[2];
   const char *config_file;
 
   GNUNET_log_setup ("test", "DEBUG", NULL);