diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-01-03 14:21:25 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-01-03 14:21:25 +0000 |
commit | 748e690fe49e2639076cb76e6a4a4c5eb04e130e (patch) | |
tree | f76bcad30b4efc1f8daaf309ba38c3496603ce82 /src/hostlist | |
parent | cb3c882dbb05a797728dfd8b5983ade5a8999eac (diff) | |
download | gnunet-748e690fe49e2639076cb76e6a4a4c5eb04e130e.tar.gz gnunet-748e690fe49e2639076cb76e6a4a4c5eb04e130e.zip |
Changed peerinfo api to distinguish between last element and timeout
Diffstat (limited to 'src/hostlist')
-rw-r--r-- | src/hostlist/hostlist-server.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c index 95272a555..4c88ae317 100644 --- a/src/hostlist/hostlist-server.c +++ b/src/hostlist/hostlist-server.c | |||
@@ -178,13 +178,21 @@ check_has_addr (void *cls, | |||
178 | static void | 178 | static void |
179 | host_processor (void *cls, | 179 | host_processor (void *cls, |
180 | const struct GNUNET_PeerIdentity * peer, | 180 | const struct GNUNET_PeerIdentity * peer, |
181 | const struct GNUNET_HELLO_Message *hello) | 181 | const struct GNUNET_HELLO_Message *hello, |
182 | const char *err_msg) | ||
182 | { | 183 | { |
183 | struct HostSet *results = cls; | 184 | struct HostSet *results = cls; |
184 | size_t old; | 185 | size_t old; |
185 | size_t s; | 186 | size_t s; |
186 | int has_addr; | 187 | int has_addr; |
187 | 188 | ||
189 | if (err_msg != NULL) | ||
190 | { | ||
191 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
192 | _("Error in communication with PEERINFO service:\n `%s'"), err_msg); | ||
193 | return; | ||
194 | } | ||
195 | |||
188 | if (peer == NULL) | 196 | if (peer == NULL) |
189 | { | 197 | { |
190 | pitr = NULL; | 198 | pitr = NULL; |
@@ -439,17 +447,25 @@ disconnect_handler (void *cls, | |||
439 | * @param cls closure (not used) | 447 | * @param cls closure (not used) |
440 | * @param peer potential peer to connect to | 448 | * @param peer potential peer to connect to |
441 | * @param hello HELLO for this peer (or NULL) | 449 | * @param hello HELLO for this peer (or NULL) |
450 | * @param err_msg NULL if successful, otherwise contains error message | ||
442 | */ | 451 | */ |
443 | static void | 452 | static void |
444 | process_notify (void *cls, | 453 | process_notify (void *cls, |
445 | const struct GNUNET_PeerIdentity *peer, | 454 | const struct GNUNET_PeerIdentity *peer, |
446 | const struct GNUNET_HELLO_Message *hello) | 455 | const struct GNUNET_HELLO_Message *hello, |
456 | const char *err_msg) | ||
447 | { | 457 | { |
448 | struct HostSet *results; | 458 | struct HostSet *results; |
449 | #if DEBUG_HOSTLIST_SERVER | 459 | #if DEBUG_HOSTLIST_SERVER |
450 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 460 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
451 | "Peerinfo is notifying us to rebuild our hostlist\n"); | 461 | "Peerinfo is notifying us to rebuild our hostlist\n"); |
452 | #endif | 462 | #endif |
463 | if (err_msg != NULL) | ||
464 | { | ||
465 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
466 | _("Error in communication with PEERINFO service\n")); | ||
467 | /* return; */ | ||
468 | } | ||
453 | results = GNUNET_malloc(sizeof(struct HostSet)); | 469 | results = GNUNET_malloc(sizeof(struct HostSet)); |
454 | GNUNET_assert (peerinfo != NULL); | 470 | GNUNET_assert (peerinfo != NULL); |
455 | pitr = GNUNET_PEERINFO_iterate (peerinfo, | 471 | pitr = GNUNET_PEERINFO_iterate (peerinfo, |