GNUNET_assert (NULL == req_tail);
if (NULL != client)
{
-#if DEBUG_RESOLVER
LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from DNS service\n");
-#endif
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
}
if (r_task != GNUNET_SCHEDULER_NO_TASK)
struct GNUNET_RESOLVER_RequestHandle *rh = cls;
uint16_t size;
-#if DEBUG_RESOLVER
LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving response from DNS service\n");
-#endif
if (msg == NULL)
{
char buf[INET6_ADDRSTRLEN];
}
GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
GNUNET_free (rh);
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
reconnect ();
return;
if (GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE != ntohs (msg->type))
{
GNUNET_break (0);
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
reconnect ();
return;
rh->name_callback (rh->cls, NULL);
GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
GNUNET_free (rh);
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
reconnect ();
return;
}
-#if DEBUG_RESOLVER
- LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolver returns `%s' for IP `%s'.\n"),
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolver returns `%s' for IP `%s'.\n",
hostname, GNUNET_a2s ((const void *) &rh[1], rh->data_len));
-#endif
if (rh->was_transmitted != GNUNET_SYSERR)
rh->name_callback (rh->cls, hostname);
rh->received_response = GNUNET_YES;
rh->addr_callback (rh->cls, NULL, 0);
GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
GNUNET_free (rh);
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
reconnect ();
return;
process_requests ()
{
struct GNUNET_RESOLVER_GetMessage *msg;
- char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
+ char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1] GNUNET_ALIGN;
struct GNUNET_RESOLVER_RequestHandle *rh;
if (NULL == client)
msg->direction = htonl (rh->direction);
msg->af = htonl (rh->af);
memcpy (&msg[1], &rh[1], rh->data_len);
-#if DEBUG_RESOLVER
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Transmitting DNS resolution request to DNS service\n");
-#endif
if (GNUNET_OK !=
GNUNET_CLIENT_transmit_and_get_response (client, &msg->header,
GNUNET_TIME_absolute_get_remaining
(rh->timeout), GNUNET_YES,
&handle_response, rh))
{
- GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+ GNUNET_CLIENT_disconnect (client);
client = NULL;
reconnect ();
return;
return; /* no work pending */
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
-#if DEBUG_RESOLVER
LOG (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to DNS service\n");
-#endif
client = GNUNET_CLIENT_connect ("resolver", resolver_cfg);
if (NULL == client)
{
break;
}
}
-#if DEBUG_RESOLVER
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Will try to connect to DNS service in %llu ms\n",
(unsigned long long) backoff.rel_value);
-#endif
GNUNET_assert (NULL != resolver_cfg);
r_task = GNUNET_SCHEDULER_add_delayed (backoff, &reconnect_task, NULL);
- backoff = GNUNET_TIME_relative_multiply (backoff, 2);
+ backoff = GNUNET_TIME_STD_BACKOFF (backoff);
}
char *result;
result = no_resolve (rh->af, &rh[1], rh->data_len);
-#if DEBUG_RESOLVER
- LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolver returns `%s'.\n"), result);
-#endif
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolver returns `%s'.\n", result);
if (result != NULL)
{
rh->name_callback (rh->cls, result);
"gethostname");
return NULL;
}
-#if DEBUG_RESOLVER
- LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolving our FQDN `%s'\n"), hostname);
-#endif
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolving our FQDN `%s'\n", hostname);
host = gethostbyname (hostname);
if (NULL == host)
{
"gethostname");
return NULL;
}
-#if DEBUG_RESOLVER
- LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolving our hostname `%s'\n"), hostname);
-#endif
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolving our hostname `%s'\n", hostname);
return GNUNET_RESOLVER_ip_get (hostname, af, timeout, callback, cls);
}