diff options
Diffstat (limited to 'src/hostlist/gnunet-daemon-hostlist_server.c')
-rw-r--r-- | src/hostlist/gnunet-daemon-hostlist_server.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/hostlist/gnunet-daemon-hostlist_server.c b/src/hostlist/gnunet-daemon-hostlist_server.c index e090bfd87..9c8b14598 100644 --- a/src/hostlist/gnunet-daemon-hostlist_server.c +++ b/src/hostlist/gnunet-daemon-hostlist_server.c | |||
@@ -430,7 +430,8 @@ access_handler_callback (void *cls, | |||
430 | /** | 430 | /** |
431 | * Handler called by CORE when CORE is ready to transmit message | 431 | * Handler called by CORE when CORE is ready to transmit message |
432 | * | 432 | * |
433 | * @param cls closure | 433 | * @param cls closure with the `const struct GNUNET_PeerIdentity *` of |
434 | * the peer we are sending to | ||
434 | * @param size size of buffer to copy message to | 435 | * @param size size of buffer to copy message to |
435 | * @param buf buffer to copy message to | 436 | * @param buf buffer to copy message to |
436 | * @return number of bytes copied to @a buf | 437 | * @return number of bytes copied to @a buf |
@@ -440,12 +441,21 @@ adv_transmit_ready (void *cls, | |||
440 | size_t size, | 441 | size_t size, |
441 | void *buf) | 442 | void *buf) |
442 | { | 443 | { |
444 | const struct GNUNET_PeerIdentity *peer = cls; | ||
443 | static uint64_t hostlist_adv_count; | 445 | static uint64_t hostlist_adv_count; |
444 | size_t transmission_size; | 446 | size_t transmission_size; |
445 | size_t uri_size; /* Including \0 termination! */ | 447 | size_t uri_size; /* Including \0 termination! */ |
446 | struct GNUNET_MessageHeader header; | 448 | struct GNUNET_MessageHeader header; |
447 | char *cbuf; | 449 | char *cbuf; |
450 | struct GNUNET_CORE_TransmitHandle *th; | ||
448 | 451 | ||
452 | th = GNUNET_CONTAINER_multipeermap_get (advertisements, | ||
453 | peer); | ||
454 | GNUNET_assert (NULL != th); | ||
455 | GNUNET_assert (GNUNET_YES == | ||
456 | GNUNET_CONTAINER_multipeermap_remove (advertisements, | ||
457 | peer, | ||
458 | th)); | ||
449 | if (NULL == buf) | 459 | if (NULL == buf) |
450 | { | 460 | { |
451 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 461 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -518,7 +528,8 @@ connect_handler (void *cls, | |||
518 | GNUNET_ADV_TIMEOUT, | 528 | GNUNET_ADV_TIMEOUT, |
519 | peer, | 529 | peer, |
520 | size, | 530 | size, |
521 | &adv_transmit_ready, NULL)) ) | 531 | &adv_transmit_ready, |
532 | (void *) peer)) ) | ||
522 | { | 533 | { |
523 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 534 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
524 | _("Advertisement message could not be queued by core\n")); | 535 | _("Advertisement message could not be queued by core\n")); |