From: Christian Grothoff Date: Thu, 12 May 2011 13:46:15 +0000 (+0000) Subject: simplify X-Git-Tag: initial-import-from-subversion-38251~18492 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d95d14541ab481ad4697a432b5598535af07804c;p=oweals%2Fgnunet.git simplify --- diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index 5d3a83d4b..cd40314f4 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -278,6 +278,14 @@ add_request_to_pending (void *cls, } +/** + * Try to send messages from list of messages to send + * @param handle DHT_Handle + */ +static void +process_pending_messages (struct GNUNET_DHT_Handle *handle); + + /** * Try reconnecting to the dht service. * @@ -289,6 +297,7 @@ try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct GNUNET_DHT_Handle *handle = cls; + handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; if (handle->retry_time.rel_value < GNUNET_CONSTANTS_SERVICE_RETRY.rel_value) handle->retry_time = GNUNET_CONSTANTS_SERVICE_RETRY; @@ -304,19 +313,10 @@ try_reconnect (void *cls, "dht reconnect failed(!)\n"); return; } - GNUNET_CONTAINER_multihashmap_iterate (handle->active_requests, &add_request_to_pending, handle); - if (handle->pending_head == NULL) - return; - - GNUNET_CLIENT_notify_transmit_ready (handle->client, - ntohs(handle->pending_head->msg->size), - GNUNET_TIME_UNIT_FOREVER_REL, - GNUNET_NO, - &transmit_pending, - handle); + process_pending_messages (handle); }