aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-18 11:40:18 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-18 11:40:18 +0000
commit7eb7f61118f27279daf2fcd4663e0d3c93195f85 (patch)
tree2de5791b82a32512760f6eca26134774d8383363 /src
parent2b0d80841a3d9a743f1213a530221dc125fab051 (diff)
downloadgnunet-7eb7f61118f27279daf2fcd4663e0d3c93195f85.tar.gz
gnunet-7eb7f61118f27279daf2fcd4663e0d3c93195f85.zip
-check for expiration and do not cache expired records; allow zone_publish_time_window to go back up, so reset it on new iterations
Diffstat (limited to 'src')
-rw-r--r--src/gns/gnunet-service-gns.c2
-rw-r--r--src/gns/gnunet-service-gns_resolver.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c
index 3e31eb547..fcbecb4e6 100644
--- a/src/gns/gnunet-service-gns.c
+++ b/src/gns/gnunet-service-gns.c
@@ -370,7 +370,7 @@ put_gns_record (void *cls,
370 { 370 {
371 zone_publish_time_window 371 zone_publish_time_window
372 = GNUNET_TIME_relative_min (min_relative_record_time, 372 = GNUNET_TIME_relative_min (min_relative_record_time,
373 zone_publish_time_window); 373 DEFAULT_ZONE_PUBLISH_TIME_WINDOW);
374 put_interval = GNUNET_TIME_relative_divide (zone_publish_time_window, 374 put_interval = GNUNET_TIME_relative_divide (zone_publish_time_window,
375 num_public_records); 375 num_public_records);
376 } 376 }
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index 6ff2d8791..4e4801c64 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -167,7 +167,7 @@ struct DnsResult
167 uint64_t expiration_time; 167 uint64_t expiration_time;
168 168
169 /** 169 /**
170 * Number of bytes in 'data'. 170 * Number of bytes in @e data.
171 */ 171 */
172 size_t data_size; 172 size_t data_size;
173 173
@@ -1767,6 +1767,12 @@ handle_dht_response (void *cls,
1767 GNS_resolver_lookup_cancel (rh); 1767 GNS_resolver_lookup_cancel (rh);
1768 return; 1768 return;
1769 } 1769 }
1770 if (0 == GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh (block->expiration_time)).rel_value_us)
1771 {
1772 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1773 "Received expired block from the DHT, will not cache it.\n");
1774 return;
1775 }
1770 /* Cache well-formed blocks */ 1776 /* Cache well-formed blocks */
1771 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1777 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1772 "Caching response from the DHT in namestore\n"); 1778 "Caching response from the DHT in namestore\n");
@@ -1845,8 +1851,6 @@ handle_namestore_block_response (void *cls,
1845 GNS_resolver_lookup_cancel (rh); 1851 GNS_resolver_lookup_cancel (rh);
1846 return; 1852 return;
1847 } 1853 }
1848 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1849 "Decrypting block from the namestore\n");
1850 if (GNUNET_OK != 1854 if (GNUNET_OK !=
1851 GNUNET_GNSRECORD_block_decrypt (block, 1855 GNUNET_GNSRECORD_block_decrypt (block,
1852 auth, 1856 auth,