diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-18 14:11:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-18 14:11:00 +0000 |
commit | 4871fb1f27887f7957fab11ca13bb154c48202fe (patch) | |
tree | 6c6acb6558cb36c65dca71962fda466cea02487e /src/gns/gnunet-service-gns.c | |
parent | bf2bb90b9e4857ee7575d6d54f1a0ef84e8f2847 (diff) | |
download | gnunet-4871fb1f27887f7957fab11ca13bb154c48202fe.tar.gz gnunet-4871fb1f27887f7957fab11ca13bb154c48202fe.zip |
-use configuration option for reset of zone_publish_time_window, also frequency should be often enough to put every record 4x within its expiration window
Diffstat (limited to 'src/gns/gnunet-service-gns.c')
-rw-r--r-- | src/gns/gnunet-service-gns.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index cc2bf3fdf..61287c079 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c | |||
@@ -168,7 +168,13 @@ static struct GNUNET_TIME_Relative min_relative_record_time; | |||
168 | static struct GNUNET_TIME_Relative put_interval; | 168 | static struct GNUNET_TIME_Relative put_interval; |
169 | 169 | ||
170 | /** | 170 | /** |
171 | * Time window for zone iteration | 171 | * Default time window for zone iteration |
172 | */ | ||
173 | static struct GNUNET_TIME_Relative zone_publish_time_window_default; | ||
174 | |||
175 | /** | ||
176 | * Time window for zone iteration, adjusted based on relative record | ||
177 | * expiration times in our zone. | ||
172 | */ | 178 | */ |
173 | static struct GNUNET_TIME_Relative zone_publish_time_window; | 179 | static struct GNUNET_TIME_Relative zone_publish_time_window; |
174 | 180 | ||
@@ -369,8 +375,9 @@ put_gns_record (void *cls, | |||
369 | else | 375 | else |
370 | { | 376 | { |
371 | zone_publish_time_window | 377 | zone_publish_time_window |
372 | = GNUNET_TIME_relative_min (min_relative_record_time, | 378 | = GNUNET_TIME_relative_min (GNUNET_TIME_relative_divide (min_relative_record_time, |
373 | DEFAULT_ZONE_PUBLISH_TIME_WINDOW); | 379 | 4), |
380 | zone_publish_time_window_default); | ||
374 | put_interval = GNUNET_TIME_relative_divide (zone_publish_time_window, | 381 | put_interval = GNUNET_TIME_relative_divide (zone_publish_time_window, |
375 | num_public_records); | 382 | num_public_records); |
376 | } | 383 | } |
@@ -449,6 +456,9 @@ put_gns_record (void *cls, | |||
449 | GNUNET_GNSRECORD_query_from_private_key (key, | 456 | GNUNET_GNSRECORD_query_from_private_key (key, |
450 | name, | 457 | name, |
451 | &query); | 458 | &query); |
459 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
460 | "Storing record in DHT with expiration `%s'\n", | ||
461 | GNUNET_STRINGS_absolute_time_to_string (expire)); | ||
452 | active_put = GNUNET_DHT_put (dht_handle, &query, | 462 | active_put = GNUNET_DHT_put (dht_handle, &query, |
453 | DHT_GNS_REPLICATION_LEVEL, | 463 | DHT_GNS_REPLICATION_LEVEL, |
454 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, | 464 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, |
@@ -684,17 +694,18 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
684 | } | 694 | } |
685 | 695 | ||
686 | put_interval = INITIAL_PUT_INTERVAL; | 696 | put_interval = INITIAL_PUT_INTERVAL; |
687 | zone_publish_time_window = DEFAULT_ZONE_PUBLISH_TIME_WINDOW; | 697 | zone_publish_time_window_default = DEFAULT_ZONE_PUBLISH_TIME_WINDOW; |
688 | |||
689 | if (GNUNET_OK == | 698 | if (GNUNET_OK == |
690 | GNUNET_CONFIGURATION_get_value_time (c, "gns", | 699 | GNUNET_CONFIGURATION_get_value_time (c, "gns", |
691 | "ZONE_PUBLISH_TIME_WINDOW", | 700 | "ZONE_PUBLISH_TIME_WINDOW", |
692 | &zone_publish_time_window)) | 701 | &zone_publish_time_window_default)) |
693 | { | 702 | { |
694 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 703 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
695 | "Time window for zone iteration: %s\n", | 704 | "Time window for zone iteration: %s\n", |
696 | GNUNET_STRINGS_relative_time_to_string (zone_publish_time_window, GNUNET_YES)); | 705 | GNUNET_STRINGS_relative_time_to_string (zone_publish_time_window, |
706 | GNUNET_YES)); | ||
697 | } | 707 | } |
708 | zone_publish_time_window = zone_publish_time_window_default; | ||
698 | if (GNUNET_OK == | 709 | if (GNUNET_OK == |
699 | GNUNET_CONFIGURATION_get_value_number (c, "gns", | 710 | GNUNET_CONFIGURATION_get_value_number (c, "gns", |
700 | "MAX_PARALLEL_BACKGROUND_QUERIES", | 711 | "MAX_PARALLEL_BACKGROUND_QUERIES", |