struct GNUNET_DHT_Handle *handle = cls;
LOG (GNUNET_ERROR_TYPE_DEBUG, "Reconnecting with DHT %p\n", handle);
- 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;
- else
- handle->retry_time = GNUNET_TIME_relative_multiply (handle->retry_time, 2);
- if (handle->retry_time.rel_value > GNUNET_CONSTANTS_SERVICE_TIMEOUT.rel_value)
- handle->retry_time = GNUNET_CONSTANTS_SERVICE_TIMEOUT;
+ handle->retry_time = GNUNET_TIME_STD_BACKOFF (handle->retry_time);
handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
if (GNUNET_YES != try_connect (handle))
{
GNUNET_CLIENT_notify_transmit_ready_cancel (handle->th);
handle->th = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Disconnecting from DHT service, will try to reconnect in %llu ms\n",
- (unsigned long long) handle->retry_time.rel_value);
+ "Disconnecting from DHT service, will try to reconnect in %s\n",
+ GNUNET_STRINGS_relative_time_to_string (handle->retry_time,
+ GNUNET_YES));
GNUNET_CLIENT_disconnect (handle->client);
handle->client = NULL;
default:
GNUNET_break(0);
LOG (GNUNET_ERROR_TYPE_WARNING,
- "Unknown DHT message type: %su\n",
- ntohs (msg->type));
+ "Unknown DHT message type: %hu (%hu) size: %hu\n",
+ ntohs (msg->type), msg->type, msize);
break;
}
if (GNUNET_OK != ret)
handle->cfg = cfg;
handle->uid_gen =
GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX);
- handle->active_requests = GNUNET_CONTAINER_multihashmap_create (ht_len);
+ handle->active_requests = GNUNET_CONTAINER_multihashmap_create (ht_len, GNUNET_NO);
if (GNUNET_NO == try_connect (handle))
{
GNUNET_DHT_disconnect (handle);