GNUNET_RESOLVER_HostnameCallback name_callback;
/**
- * Closure for the respective "callback".
+ * Closure for the callbacks.
*/
void *cls;
* Task handle for making reply callbacks in numeric lookups
* asynchronous, and for timeout handling.
*/
- struct GNUNET_SCHEDULER_Task * task;
+ struct GNUNET_SCHEDULER_Task *task;
/**
* Desired address family.
"resolver");
return GNUNET_SYSERR;
}
- if ((1 != inet_pton (AF_INET, hostname, &v4)) ||
- (1 != inet_pton (AF_INET6, hostname, &v6)))
+ if ((1 == inet_pton (AF_INET, hostname, &v4)) ||
+ (1 == inet_pton (AF_INET6, hostname, &v6)))
{
GNUNET_free (hostname);
return GNUNET_OK;
* numeric addresses.
*
* @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request
- * @param tc unused scheduler context
*/
static void
-numeric_resolution (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+numeric_resolution (void *cls)
{
struct GNUNET_RESOLVER_RequestHandle *rh = cls;
struct sockaddr_in v4;
* respective loopback numeric addresses.
*
* @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request
- * @param tc unused scheduler context
*/
static void
-loopback_resolution (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+loopback_resolution (void *cls)
{
struct GNUNET_RESOLVER_RequestHandle *rh = cls;
struct sockaddr_in v4;
rh->addr_callback (rh->cls,
(const struct sockaddr *) &v4,
sizeof (v4));
+
break;
default:
GNUNET_break (0);
* Task executed on system shutdown.
*/
static void
-shutdown_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
{
s_task = NULL;
GNUNET_RESOLVER_disconnect ();
/* nothing to do, release socket really soon if there is nothing
* else happening... */
s_task =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
&shutdown_task,
NULL);
return;
* Now try to reconnect to the resolver service.
*
* @param cls NULL
- * @param tc scheduler context
*/
static void
-reconnect_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+reconnect_task (void *cls)
{
r_task = NULL;
if (NULL == req_head)
return; /* no work pending */
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Trying to connect to DNS service\n");
client = GNUNET_CLIENT_connect ("resolver",
break;
case GNUNET_SYSERR:
/* request was cancelled, remove entirely */
- GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
+ GNUNET_CONTAINER_DLL_remove (req_head,
+ req_tail,
+ rh);
GNUNET_free (rh);
break;
default:
* A DNS resolution timed out. Notify the application.
*
* @param cls the `struct GNUNET_RESOLVER_RequestHandle *`
- * @param tc scheduler context
*/
static void
-handle_lookup_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+handle_lookup_timeout (void *cls)
{
struct GNUNET_RESOLVER_RequestHandle *rh = cls;
* conversion and invoke the callback.
*
* @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request
- * @param tc unused scheduler context
*/
static void
-numeric_reverse (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+numeric_reverse (void *cls)
{
struct GNUNET_RESOLVER_RequestHandle *rh = cls;
char *result;