gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r30302 - gnunet/src/gns
Date: Fri, 18 Oct 2013 13:40:18 +0200

Author: grothoff
Date: 2013-10-18 13:40:18 +0200 (Fri, 18 Oct 2013)
New Revision: 30302

Modified:
   gnunet/src/gns/gnunet-service-gns.c
   gnunet/src/gns/gnunet-service-gns_resolver.c
Log:
-check for expiration and do not cache expired records; allow 
zone_publish_time_window to go back up, so reset it on new iterations

Modified: gnunet/src/gns/gnunet-service-gns.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns.c 2013-10-18 11:39:51 UTC (rev 30301)
+++ gnunet/src/gns/gnunet-service-gns.c 2013-10-18 11:40:18 UTC (rev 30302)
@@ -370,7 +370,7 @@
     {
       zone_publish_time_window
         = GNUNET_TIME_relative_min (min_relative_record_time,
-                                    zone_publish_time_window);
+                                    DEFAULT_ZONE_PUBLISH_TIME_WINDOW);
       put_interval = GNUNET_TIME_relative_divide (zone_publish_time_window,
                                                  num_public_records);
     }

Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c        2013-10-18 11:39:51 UTC 
(rev 30301)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c        2013-10-18 11:40:18 UTC 
(rev 30302)
@@ -167,7 +167,7 @@
   uint64_t expiration_time;
 
   /**
-   * Number of bytes in 'data'.
+   * Number of bytes in @e data.
    */
   size_t data_size;
 
@@ -1767,6 +1767,12 @@
     GNS_resolver_lookup_cancel (rh);
     return;
   }
+  if (0 == GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh 
(block->expiration_time)).rel_value_us)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Received expired block from the DHT, will not cache it.\n");
+    return;
+  }
   /* Cache well-formed blocks */
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Caching response from the DHT in namestore\n");
@@ -1845,8 +1851,6 @@
     GNS_resolver_lookup_cancel (rh);
     return;
   }
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Decrypting block from the namestore\n");
   if (GNUNET_OK !=
       GNUNET_GNSRECORD_block_decrypt (block,
                                      auth,




reply via email to

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