debug flag
authorNathan S. Evans <evans@in.tum.de>
Fri, 8 Jul 2011 17:11:25 +0000 (17:11 +0000)
committerNathan S. Evans <evans@in.tum.de>
Fri, 8 Jul 2011 17:11:25 +0000 (17:11 +0000)
src/peerinfo-tool/gnunet-list-connections.c

index d95b0a757cf082db9b879fa4b3e811c80fc04bf3..9c9cf987be84af3a4a55e8101d2df0e2321dfe61 100644 (file)
 #include "gnunet_core_service.h"
 #include "gnunet_program_lib.h"
 
+#define VERBOSE 0
 static int no_resolve;
 
+#if VERBOSE
+  static unsigned int peer_count;
+#endif
 
 static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
@@ -127,6 +131,7 @@ connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
     {
 #if VERBOSE
       fprintf(stderr, "Learned about peer %s\n", GNUNET_i2s(peer));
+      peer_count++;
 #endif
       pc = GNUNET_malloc (sizeof (struct PrintContext));
       pc->peer = *peer;
@@ -134,6 +139,12 @@ connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
                                             GNUNET_TIME_UNIT_MINUTES,
                                             &process_resolved_address, pc);
     }
+#if VERBOSE
+  else
+    {
+      fprintf(stderr, "Counted %u total connected peers.\n", peer_count);
+    }
+#endif
 }