diff options
Diffstat (limited to 'src/gns/gnunet-service-gns.c')
-rw-r--r-- | src/gns/gnunet-service-gns.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index ca2e80fd0..530318808 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c | |||
@@ -236,15 +236,6 @@ static int v6_enabled; | |||
236 | static int v4_enabled; | 236 | static int v4_enabled; |
237 | 237 | ||
238 | /** | 238 | /** |
239 | * Did we finish the initial iteration over the namestore? | ||
240 | * (while we do the initial iteration, we do not generate | ||
241 | * DHT PUTs as there might be WAY too many of those). | ||
242 | * TODO: expand namestore monitor API with a way to | ||
243 | * suppress this initial iteration. | ||
244 | */ | ||
245 | static int sync_finished; | ||
246 | |||
247 | /** | ||
248 | * Handle to the statistics service | 239 | * Handle to the statistics service |
249 | */ | 240 | */ |
250 | static struct GNUNET_STATISTICS_Handle *statistics; | 241 | static struct GNUNET_STATISTICS_Handle *statistics; |
@@ -485,8 +476,9 @@ perform_dht_put (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
485 | label, | 476 | label, |
486 | &query); | 477 | &query); |
487 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 478 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
488 | "Storing record in DHT with expiration `%s'\n", | 479 | "Storing record in DHT with expiration `%s' under key %s\n", |
489 | GNUNET_STRINGS_absolute_time_to_string (expire)); | 480 | GNUNET_STRINGS_absolute_time_to_string (expire), |
481 | GNUNET_h2s (&query)); | ||
490 | ret = GNUNET_DHT_put (dht_handle, &query, | 482 | ret = GNUNET_DHT_put (dht_handle, &query, |
491 | DHT_GNS_REPLICATION_LEVEL, | 483 | DHT_GNS_REPLICATION_LEVEL, |
492 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, | 484 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, |
@@ -646,9 +638,10 @@ handle_monitor_event (void *cls, | |||
646 | unsigned int rd_public_count; | 638 | unsigned int rd_public_count; |
647 | struct MonitorActivity *ma; | 639 | struct MonitorActivity *ma; |
648 | 640 | ||
649 | if (GNUNET_YES != sync_finished) | 641 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
650 | return; /* do not do DHT PUTs on initial sync, as that may | 642 | "Received %u records for label `%s' via namestore monitor\n", |
651 | create far too many PUTs on startup */ | 643 | rd_count, |
644 | label); | ||
652 | /* filter out records that are not public, and convert to | 645 | /* filter out records that are not public, and convert to |
653 | absolute expiration time. */ | 646 | absolute expiration time. */ |
654 | rd_public_count = convert_records_for_export (rd, rd_count, | 647 | rd_public_count = convert_records_for_export (rd, rd_count, |
@@ -833,7 +826,6 @@ notify_client_disconnect (void *cls, | |||
833 | static void | 826 | static void |
834 | monitor_sync_event (void *cls) | 827 | monitor_sync_event (void *cls) |
835 | { | 828 | { |
836 | sync_finished = GNUNET_YES; | ||
837 | zone_publish_task = GNUNET_SCHEDULER_add_now (&publish_zone_dht_start, | 829 | zone_publish_task = GNUNET_SCHEDULER_add_now (&publish_zone_dht_start, |
838 | NULL); | 830 | NULL); |
839 | } | 831 | } |
@@ -955,9 +947,11 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
955 | nc = GNUNET_SERVER_notification_context_create (server, 1); | 947 | nc = GNUNET_SERVER_notification_context_create (server, 1); |
956 | zmon = GNUNET_NAMESTORE_zone_monitor_start (c, | 948 | zmon = GNUNET_NAMESTORE_zone_monitor_start (c, |
957 | NULL, | 949 | NULL, |
950 | GNUNET_NO, | ||
958 | &handle_monitor_event, | 951 | &handle_monitor_event, |
959 | &monitor_sync_event, | 952 | &monitor_sync_event, |
960 | NULL); | 953 | NULL); |
954 | GNUNET_break (NULL != zmon); | ||
961 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 955 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
962 | &shutdown_task, NULL); | 956 | &shutdown_task, NULL); |
963 | } | 957 | } |