- fixes, intendation
[oweals/gnunet.git] / src / gns / gnunet-service-gns_resolver.c
index c505ca59a214d82023c063a2292a75dc3f15dd2a..580233da39e9491b9853b2649a727afec4da1bcc 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2011-2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2011-2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -334,7 +334,7 @@ struct GNS_ResolverHandle
   /**
    * ID of a task associated with the resolution process.
    */
-  GNUNET_SCHEDULER_TaskIdentifier task_id;
+  struct GNUNET_SCHEDULER_Task * task_id;
 
   /**
    * The name to resolve
@@ -549,7 +549,7 @@ fail_resolution (void *cls,
 {
   struct GNS_ResolverHandle *rh = cls;
 
-  rh->task_id = GNUNET_SCHEDULER_NO_TASK;
+  rh->task_id = NULL;
   rh->proc (rh->proc_cls, 0, NULL);
   GNS_resolver_lookup_cancel (rh);
 }
@@ -767,15 +767,15 @@ handle_dns_result (void *cls,
   const struct sockaddr_in *sa4;
   const struct sockaddr_in6 *sa6;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Received %u bytes of DNS IP data\n",
-             addrlen);
   if (NULL == addr)
   {
     rh->std_resolve = NULL;
     transmit_lookup_dns_result (rh);
     return;
   }
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Received %u bytes of DNS IP data\n",
+             addrlen);
   switch (addr->sa_family)
   {
   case AF_INET:
@@ -845,7 +845,7 @@ dns_result_parser (void *cls,
 
   rh->dns_request = NULL;
   GNUNET_SCHEDULER_cancel (rh->task_id);
-  rh->task_id = GNUNET_SCHEDULER_NO_TASK;
+  rh->task_id = NULL;
   p = GNUNET_DNSPARSER_parse ((const char *) dns,
                              dns_len);
   if (NULL == p)
@@ -1839,6 +1839,7 @@ handle_gns_resolution_result (void *cls,
            resolver to use */
         g2dc = GNUNET_new (struct Gns2DnsContext);
         g2dc->ns = ns;
+
         g2dc->rh = GNUNET_new (struct GNS_ResolverHandle);
         g2dc->rh->authority_zone = rh->ac_tail->authority_info.gns_authority;
         ip = translate_dot_plus (rh, ip);
@@ -2231,7 +2232,7 @@ recursive_resolution (void *cls,
 {
   struct GNS_ResolverHandle *rh = cls;
 
-  rh->task_id = GNUNET_SCHEDULER_NO_TASK;
+  rh->task_id = NULL;
   if (MAX_RECURSION < rh->loop_limiter++)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -2455,10 +2456,10 @@ GNS_resolver_lookup_cancel (struct GNS_ResolverHandle *rh)
     GNUNET_free (rh->g2dc);
     rh->g2dc = NULL;
   }
-  if (GNUNET_SCHEDULER_NO_TASK != rh->task_id)
+  if (NULL != rh->task_id)
   {
     GNUNET_SCHEDULER_cancel (rh->task_id);
-    rh->task_id = GNUNET_SCHEDULER_NO_TASK;
+    rh->task_id = NULL;
   }
   if (NULL != rh->get_handle)
   {