From e60aaddfc196474cc0df128dc88645413a9d1e34 Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Fri, 8 Jul 2011 17:11:25 +0000 Subject: [PATCH] debug flag --- src/peerinfo-tool/gnunet-list-connections.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/peerinfo-tool/gnunet-list-connections.c b/src/peerinfo-tool/gnunet-list-connections.c index d95b0a757..9c9cf987b 100644 --- a/src/peerinfo-tool/gnunet-list-connections.c +++ b/src/peerinfo-tool/gnunet-list-connections.c @@ -32,8 +32,12 @@ #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 } -- 2.25.1