From 1d8ceb83e447e32450597d98dfa3fea638b59cf5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20B=C3=BCnger?= Date: Fri, 24 Jul 2015 09:39:40 +0000 Subject: [PATCH] -logging --- src/rps/gnunet-service-rps.c | 10 +++++++++- src/rps/gnunet-service-rps_sampler_elem.c | 6 ------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 547d0d57e..8ff3755e2 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c @@ -1276,6 +1276,7 @@ nse_callback (void *cls, struct GNUNET_TIME_Absolute timestamp, void client_respond (void *cls, struct GNUNET_PeerIdentity *peer_ids, uint32_t num_peers) { + uint32_t i; struct GNUNET_MQ_Envelope *ev; struct GNUNET_RPS_CS_ReplyMessage *out_msg; struct ReplyCls *reply_cls = (struct ReplyCls *) cls; @@ -1283,8 +1284,15 @@ void client_respond (void *cls, struct ClientContext *cli_ctx; LOG (GNUNET_ERROR_TYPE_DEBUG, - "sampler returned %" PRIu32 " peers\n", + "sampler returned %" PRIu32 " peers:\n", num_peers); + for (i = 0; i < num_peers; i++) + { + LOG (GNUNET_ERROR_TYPE_DEBUG, + " %lu: %s\n", + i, + GNUNET_i2s (&peer_ids[i])); + } size_needed = sizeof (struct GNUNET_RPS_CS_ReplyMessage) + num_peers * sizeof (struct GNUNET_PeerIdentity); diff --git a/src/rps/gnunet-service-rps_sampler_elem.c b/src/rps/gnunet-service-rps_sampler_elem.c index 5354c8081..4138700af 100644 --- a/src/rps/gnunet-service-rps_sampler_elem.c +++ b/src/rps/gnunet-service-rps_sampler_elem.c @@ -118,8 +118,6 @@ RPS_sampler_elem_next (struct RPS_SamplerElement *s_elem, if (0 == GNUNET_CRYPTO_cmp_peer_identity (other, &(s_elem->peer_id))) { - LOG (GNUNET_ERROR_TYPE_DEBUG, " Got PeerID %s\n", - GNUNET_i2s (other)); LOG (GNUNET_ERROR_TYPE_DEBUG, "Have already PeerID %s\n", GNUNET_i2s (&(s_elem->peer_id))); } @@ -142,8 +140,6 @@ RPS_sampler_elem_next (struct RPS_SamplerElement *s_elem, } else if (0 > GNUNET_CRYPTO_hash_cmp (&other_hash, &s_elem->peer_id_hash)) { - LOG (GNUNET_ERROR_TYPE_DEBUG, " Got PeerID %s\n", - GNUNET_i2s (other)); LOG (GNUNET_ERROR_TYPE_DEBUG, "Discarding old PeerID %s\n", GNUNET_i2s (&s_elem->peer_id)); s_elem->peer_id = *other; @@ -153,8 +149,6 @@ RPS_sampler_elem_next (struct RPS_SamplerElement *s_elem, } else { - LOG (GNUNET_ERROR_TYPE_DEBUG, " Got PeerID %s\n", - GNUNET_i2s (other)); LOG (GNUNET_ERROR_TYPE_DEBUG, "Keeping old PeerID %s\n", GNUNET_i2s (&s_elem->peer_id)); } -- 2.25.1