gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29031 - gnunet/src/gns


From: gnunet
Subject: [GNUnet-SVN] r29031 - gnunet/src/gns
Date: Thu, 5 Sep 2013 16:20:12 +0200

Author: grothoff
Date: 2013-09-05 16:20:12 +0200 (Thu, 05 Sep 2013)
New Revision: 29031

Modified:
   gnunet/src/gns/gnunet-service-gns_resolver.c
Log:
-more precise check when to go to DHT (SVN 3017)

Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c        2013-09-05 13:39:43 UTC 
(rev 29030)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c        2013-09-05 14:20:12 UTC 
(rev 29031)
@@ -30,7 +30,7 @@
  *
  * 1. The entry in the DHT is RSL_RECORD_EXPIRED OR
  * 2. No entry in the NS existed AND
- * 3. The zone queried is not the local resolver's zone AND
+ * 3. The zone queried is not the local resolver's zone (obsolte!) AND
  * 4. The name that was looked up is '+'
  *    because if it was any other canonical name we either already queried
  *    the DHT for the authority in the authority lookup phase (and thus
@@ -387,7 +387,6 @@
  */
 static struct GNS_ResolverHandle *rlh_tail;
 
-
 /**
  * Global configuration.
  */
@@ -1623,7 +1622,9 @@
                                          label,
                                          &query);
   rh->namestore_qe = NULL;
-  if (NULL == block)
+  if ( (GNUNET_NO == rh->only_cached) &&
+       ( (NULL == block) ||
+        (0 == GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh 
(block->expiration_time)).rel_value_us) ) )
   {
     /* Namestore knows nothing; try DHT lookup */
     rh->get_handle = GNUNET_DHT_get_start (dht_handle,
@@ -1645,6 +1646,14 @@
     }
     return;
   }
+  if ( (NULL == block) ||
+       (0 == GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh 
(block->expiration_time)).rel_value_us) )
+  {
+    /* DHT not permitted and no local result, fail */
+    rx->proc (rx->proc_cls, 0, NULL);
+    GNS_resolver_lookup_cancel (rx);
+    return;
+  }
   if (GNUNET_OK !=
       GNUNET_NAMESTORE_block_decrypt (block,
                                      auth,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]