From 320c2d50b722eeffc50cd6db0c5361886ee750b0 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Mon, 3 Jan 2011 10:28:17 +0000 Subject: Fixed failing test and discrepancy between documentation and implemented functionality: GNUNET_PEERINFO_iterate never returns NULL, but always an iterator context GNUNET_PEERINFO_iterate calls callback with Peer==NULL and HELLO==NULL when timeout occurs --- src/peerinfo-tool/gnunet-peerinfo.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/peerinfo-tool') diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index 7a0877995..42adcaad8 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c @@ -142,7 +142,7 @@ print_address (void *cls, addrlen, no_resolve, tname, - GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 20), + GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10), &process_resolved_address, pc); return GNUNET_OK; @@ -164,6 +164,7 @@ print_peer_info (void *cls, if (peer == NULL) { + fprintf (stderr,_("Error in communication with PEERINFO service\n")); GNUNET_PEERINFO_disconnect (peerinfo); return; } @@ -222,13 +223,11 @@ run (void *cls, _("Could not access PEERINFO service. Exiting.\n")); return; } - if (NULL == GNUNET_PEERINFO_iterate (peerinfo, + GNUNET_PEERINFO_iterate (peerinfo, NULL, GNUNET_TIME_relative_multiply - (GNUNET_TIME_UNIT_SECONDS, 20), - &print_peer_info, NULL)) - fprintf (stderr, - _("Error in communication with PEERINFO service\n")); + (GNUNET_TIME_UNIT_SECONDS, 5), + &print_peer_info, NULL); } else { -- cgit v1.2.3