-verbose is independent of logging
[oweals/gnunet.git] / src / topology / test_gnunet_daemon_topology.c
index 3429f50ec3b42184f5890dc51879964a93280dbd..7592ede1d4c117cee69f114ceb106d6b722fab92 100644 (file)
@@ -81,14 +81,14 @@ clean_up_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   unsigned int i;
 
-  for (i=0;i<NUM_PEERS;i++)
+  for (i = 0; i < NUM_PEERS; i++)
+  {
+    if (NULL != cc[i])
     {
-      if (NULL != cc[i])
-       {
-         GNUNET_TESTING_daemons_connect_cancel (cc[i]);
-         cc[i] = NULL;
-       }
+      GNUNET_TESTING_daemons_connect_cancel (cc[i]);
+      cc[i] = NULL;
     }
+  }
   GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
   ok = 0;
 }
@@ -104,19 +104,19 @@ notify_connect_complete (void *cls, const struct GNUNET_PeerIdentity *first,
                          struct GNUNET_TESTING_Daemon *second_daemon,
                          const char *emsg)
 {
-  struct GNUNET_TESTING_ConnectContext **cc;
+  struct GNUNET_TESTING_ConnectContext **cc = cls;
   unsigned int i;
 
   *cc = NULL;
   if (NULL != emsg)
   {
-    fprintf (stderr, "Failed to connect two peers: %s\n", emsg);
-    for (i=0;i<NUM_PEERS;i++)
+    FPRINTF (stderr, "Failed to connect two peers: %s\n", emsg);
+    for (i = 0; i < NUM_PEERS; i++)
       if (NULL != cc[i])
-       {
-         GNUNET_TESTING_daemons_connect_cancel (cc[i]);
-         cc[i] = NULL;
-       }
+      {
+        GNUNET_TESTING_daemons_connect_cancel (cc[i]);
+        cc[i] = NULL;
+      }
     GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
     GNUNET_assert (0);
     return;
@@ -145,13 +145,17 @@ my_cb (void *cls, const struct GNUNET_PeerIdentity *id,
     last = d;
     return;
   }
-  cc[peers_left] = GNUNET_TESTING_daemons_connect (last, d, TIMEOUT, CONNECT_ATTEMPTS,
-                                                  GNUNET_YES, &notify_connect_complete, &cc[peers_left]);
+  cc[peers_left] =
+      GNUNET_TESTING_daemons_connect (last, d, TIMEOUT, CONNECT_ATTEMPTS,
+                                      GNUNET_YES, &notify_connect_complete,
+                                      &cc[peers_left]);
   if (peers_left == 0)
   {
     /* close circle */
-    cc[NUM_PEERS-1] = GNUNET_TESTING_daemons_connect (d, first, TIMEOUT, CONNECT_ATTEMPTS,
-                                                     GNUNET_YES, &notify_connect_complete, &cc[peers_left]);
+    cc[NUM_PEERS - 1] =
+        GNUNET_TESTING_daemons_connect (d, first, TIMEOUT, CONNECT_ATTEMPTS,
+                                        GNUNET_YES, &notify_connect_complete,
+                                        &cc[NUM_PEERS - 1]);
   }
 }