- fixes, intendation
[oweals/gnunet.git] / src / gns / gnunet-service-gns_resolver.c
index 9db5b1b99aec5c96fd6c20d6379137bbf851f65f..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)
@@ -1628,8 +1628,7 @@ handle_gns_resolution_result (void *cls,
          struct GNUNET_DNSPARSER_SrvRecord *srv;
 
          off = 0;
-         srv = GNUNET_DNSPARSER_parse_srv (rh->name,
-                                           rd[i].data,
+         srv = GNUNET_DNSPARSER_parse_srv (rd[i].data,
                                            rd[i].data_size,
                                            &off);
          if ( (NULL == srv) ||
@@ -1639,7 +1638,6 @@ handle_gns_resolution_result (void *cls,
          }
          else
          {
-           srv->domain_name = translate_dot_plus (rh, srv->domain_name);
            srv->target = translate_dot_plus (rh, srv->target);
            scratch_start = scratch_off;
            if (GNUNET_OK !=
@@ -1841,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);
@@ -2233,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,
@@ -2457,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)
   {