Fix perf_crypto_rsa.c after various changes
[oweals/gnunet.git] / src / util / resolver_api.c
index 52519a8010ee444e8a854b0214a69c864e9396e6..0488d6a3c1227c2fa3e7e4054ec8647d3bf875ed 100644 (file)
@@ -118,7 +118,7 @@ struct GNUNET_RESOLVER_RequestHandle
   GNUNET_RESOLVER_HostnameCallback name_callback;
 
   /**
-   * Closure for the respective "callback".
+   * Closure for the callbacks.
    */
   void *cls;
 
@@ -131,7 +131,7 @@ struct GNUNET_RESOLVER_RequestHandle
    * 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.
@@ -206,8 +206,8 @@ check_config ()
          "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;
@@ -532,11 +532,9 @@ handle_response (void *cls,
  * 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;
@@ -600,11 +598,9 @@ numeric_resolution (void *cls,
  * 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;
@@ -642,6 +638,7 @@ loopback_resolution (void *cls,
     rh->addr_callback (rh->cls,
                        (const struct sockaddr *) &v4,
                        sizeof (v4));
+
     break;
   default:
     GNUNET_break (0);
@@ -658,8 +655,7 @@ loopback_resolution (void *cls,
  * 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 ();
@@ -688,7 +684,7 @@ process_requests ()
     /* 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;
@@ -728,17 +724,13 @@ process_requests ()
  * 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",
@@ -778,7 +770,9 @@ reconnect ()
       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:
@@ -802,11 +796,9 @@ reconnect ()
  * 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;
 
@@ -902,11 +894,9 @@ GNUNET_RESOLVER_ip_get (const char *hostname,
  * 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;