-eliminate consensus warnings
[oweals/gnunet.git] / src / gns / gnunet-service-gns_resolver.c
index 058d0c97175c1a9452fcc1f5248fd85f0bbacc94..627be0b1726dccb67688aca052d8f695a3124781 100644 (file)
@@ -29,7 +29,6 @@
 #include "gnunet_dns_service.h"
 #include "gnunet_dht_service.h"
 #include "gnunet_namestore_service.h"
-#include "gnunet_vpn_service.h"
 #include "gnunet_dns_service.h"
 #include "gnunet_resolver_service.h"
 #include "gnunet_dnsparser_lib.h"
 #include "block_gns.h"
 #include "gns.h"
 #include "gnunet-service-gns_resolver.h"
+#ifndef WINDOWS
+#include "gnunet_vpn_service.h"
+#endif
+
 
 /**
  * Default DHT timeout
  */
 static struct GNUNET_NAMESTORE_Handle *namestore_handle;
 
+#ifndef WINDOWS
 /**
  * Our handle to the vpn service
  */
 static struct GNUNET_VPN_Handle *vpn_handle;
+#endif
 
 /**
  * Resolver handle to the dht
@@ -428,7 +433,7 @@ process_auth_discovery_dht_result (void* cls,
     {
       for (i=0; i < num_records; i++)
       {
-        if ((strcmp (name, "+") == 0) &&
+        if ((strcmp (name, GNUNET_GNS_MASTERZONE_STR) == 0) &&
             (rd[i].record_type == GNUNET_GNS_RECORD_PSEU))
         {
           /* found pseu */
@@ -544,7 +549,7 @@ process_zone_to_name_discover (void *cls,
   {
     gph->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle,
                                     &gph->auth->zone,
-                                    "+",
+                                    GNUNET_GNS_MASTERZONE_STR,
                                     GNUNET_GNS_RECORD_PSEU,
                                     &process_auth_discovery_ns_result,
                                     gph);
@@ -1240,6 +1245,7 @@ process_record_result_ns (void* cls,
 }
 
 
+#ifndef WINDOWS
 /**
  * VPN redirect result callback
  *
@@ -1305,6 +1311,7 @@ process_record_result_vpn (void* cls, int af, const void *address)
              rh->id);
   rh->proc (rh->proc_cls, rh, 0, NULL);
 }
+#endif
 
 
 /**
@@ -1335,7 +1342,8 @@ handle_record_vpn (void* cls, struct ResolverHandle *rh,
 
   /* results found yay */
   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
-             "GNS_PHASE_REC_VPN-%llu: Record resolved from VPN!", rh->id);
+             "GNS_PHASE_REC_VPN-%llu: Record resolved from VPN!\n",
+            rh->id);
 
   finish_lookup(rh, rlh, rd_count, rd);
 }
@@ -1804,6 +1812,7 @@ resolve_record_vpn (struct ResolverHandle *rh,
     af = AF_INET;
   else
     af = AF_INET6;
+#ifndef WINDOWS
   if (NULL == vpn_handle)
   {
     vpn_handle = GNUNET_VPN_connect (cfg);
@@ -1824,6 +1833,11 @@ resolve_record_vpn (struct ResolverHandle *rh,
                                                GNUNET_TIME_UNIT_FOREVER_ABS, //FIXME
                                                &process_record_result_vpn,
                                                rh);
+#else
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+             "Error connecting to VPN (not available on W32 yet)\n");
+  finish_lookup (rh, rh->proc_cls, 0, NULL);  
+#endif
 }
 
 
@@ -2290,7 +2304,7 @@ process_delegation_result_dht (void* cls,
     /* Check for key revocation and delegate */
     rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle,
                                     &rh->authority,
-                                    "+",
+                                    GNUNET_GNS_MASTERZONE_STR,
                                     GNUNET_GNS_RECORD_REV,
                                     &process_pkey_revocation_result_ns,
                                     rh);
@@ -2431,7 +2445,7 @@ finish_lookup (struct ResolverHandle *rh,
     
     GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                "GNS_POSTPROCESS: Postprocessing\n");
-    if (0 == strcmp(rh->name, "+"))
+    if (0 == strcmp(rh->name, GNUNET_GNS_MASTERZONE_STR))
       repl_string = rlh->name;
     else
       repl_string = rlh->name+strlen(rh->name)+1;
@@ -2591,7 +2605,7 @@ handle_record_ns (void* cls, struct ResolverHandle *rh,
     check_dht = GNUNET_NO;
   }
   
-  if ((0 != strcmp (rh->name, "+")) && (GNUNET_YES == is_srv (rh->name)))
+  if ((0 != strcmp (rh->name, GNUNET_GNS_MASTERZONE_STR)) && (GNUNET_YES == is_srv (rh->name)))
       check_dht = GNUNET_NO;
 
   if (GNUNET_YES == rh->only_cached)
@@ -3213,7 +3227,7 @@ process_delegation_result_ns (void* cls,
     /* Check for key revocation and delegate */
     rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle,
                                                         &rh->authority,
-                                                        "+",
+                                                        GNUNET_GNS_MASTERZONE_STR,
                                                         GNUNET_GNS_RECORD_REV,
                                                         &process_pkey_revocation_result_ns,
                                                         rh);
@@ -3422,8 +3436,8 @@ gns_resolver_lookup_record (struct GNUNET_CRYPTO_ShortHashCode zone,
     else
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Cannot handle this TLD %s\n", string_hash);
-      
+                  _("Not a GADS TLD: `%s'\n"), 
+                 name);      
       if (GNUNET_SCHEDULER_NO_TASK != rh->timeout_task)
         GNUNET_SCHEDULER_cancel (rh->timeout_task);
       GNUNET_CONTAINER_DLL_remove (rlh_head, rlh_tail, rh);