diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-01-03 10:28:17 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-01-03 10:28:17 +0000 |
commit | 320c2d50b722eeffc50cd6db0c5361886ee750b0 (patch) | |
tree | 73d94d4766a398e58e68998db8d3538557eb2a75 /src/peerinfo-tool | |
parent | b85229645add2ce8255eb8ee620b6807a96f8e81 (diff) | |
download | gnunet-320c2d50b722eeffc50cd6db0c5361886ee750b0.tar.gz gnunet-320c2d50b722eeffc50cd6db0c5361886ee750b0.zip |
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
Diffstat (limited to 'src/peerinfo-tool')
-rw-r--r-- | src/peerinfo-tool/gnunet-peerinfo.c | 11 |
1 files changed, 5 insertions, 6 deletions
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, | |||
142 | addrlen, | 142 | addrlen, |
143 | no_resolve, | 143 | no_resolve, |
144 | tname, | 144 | tname, |
145 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 20), | 145 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10), |
146 | &process_resolved_address, | 146 | &process_resolved_address, |
147 | pc); | 147 | pc); |
148 | return GNUNET_OK; | 148 | return GNUNET_OK; |
@@ -164,6 +164,7 @@ print_peer_info (void *cls, | |||
164 | 164 | ||
165 | if (peer == NULL) | 165 | if (peer == NULL) |
166 | { | 166 | { |
167 | fprintf (stderr,_("Error in communication with PEERINFO service\n")); | ||
167 | GNUNET_PEERINFO_disconnect (peerinfo); | 168 | GNUNET_PEERINFO_disconnect (peerinfo); |
168 | return; | 169 | return; |
169 | } | 170 | } |
@@ -222,13 +223,11 @@ run (void *cls, | |||
222 | _("Could not access PEERINFO service. Exiting.\n")); | 223 | _("Could not access PEERINFO service. Exiting.\n")); |
223 | return; | 224 | return; |
224 | } | 225 | } |
225 | if (NULL == GNUNET_PEERINFO_iterate (peerinfo, | 226 | GNUNET_PEERINFO_iterate (peerinfo, |
226 | NULL, | 227 | NULL, |
227 | GNUNET_TIME_relative_multiply | 228 | GNUNET_TIME_relative_multiply |
228 | (GNUNET_TIME_UNIT_SECONDS, 20), | 229 | (GNUNET_TIME_UNIT_SECONDS, 5), |
229 | &print_peer_info, NULL)) | 230 | &print_peer_info, NULL); |
230 | fprintf (stderr, | ||
231 | _("Error in communication with PEERINFO service\n")); | ||
232 | } | 231 | } |
233 | else | 232 | else |
234 | { | 233 | { |