From: Nathan S. Evans Date: Fri, 8 Jul 2011 17:11:25 +0000 (+0000) Subject: debug flag X-Git-Tag: initial-import-from-subversion-38251~17927 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e60aaddfc196474cc0df128dc88645413a9d1e34;p=oweals%2Fgnunet.git debug flag --- 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 }