aboutsummaryrefslogtreecommitdiff
path: root/src/zonemaster
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-05-05 23:18:00 +0200
committerChristian Grothoff <christian@grothoff.org>2018-05-05 23:18:00 +0200
commit645b26ba88218c4a2f9a022968a8c03e9035082d (patch)
tree7a32403fdd32c4f1b01ddc78de920f4b01bd7d9b /src/zonemaster
parent04a5c505163a84f8a7097dc7b32cf8051c74c214 (diff)
downloadgnunet-645b26ba88218c4a2f9a022968a8c03e9035082d.tar.gz
gnunet-645b26ba88218c4a2f9a022968a8c03e9035082d.zip
update namestore monitor API users to use new _next call where needed
Diffstat (limited to 'src/zonemaster')
-rw-r--r--src/zonemaster/gnunet-service-zonemaster.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c
index 7129cf44f..cbb890589 100644
--- a/src/zonemaster/gnunet-service-zonemaster.c
+++ b/src/zonemaster/gnunet-service-zonemaster.c
@@ -60,6 +60,12 @@
60#define DHT_QUEUE_LIMIT 2000 60#define DHT_QUEUE_LIMIT 2000
61 61
62/** 62/**
63 * How many events may the namestore give us before it has to wait
64 * for us to keep up?
65 */
66#define NAMESTORE_QUEUE_LIMIT 50
67
68/**
63 * The initial interval in milliseconds btween puts in 69 * The initial interval in milliseconds btween puts in
64 * a zone iteration 70 * a zone iteration
65 */ 71 */
@@ -374,6 +380,8 @@ dht_put_monitor_continuation (void *cls)
374{ 380{
375 struct DhtPutActivity *ma = cls; 381 struct DhtPutActivity *ma = cls;
376 382
383 GNUNET_NAMESTORE_zone_monitor_next (zmon,
384 1);
377 ma_queue_length--; 385 ma_queue_length--;
378 GNUNET_CONTAINER_DLL_remove (ma_head, 386 GNUNET_CONTAINER_DLL_remove (ma_head,
379 ma_tail, 387 ma_tail,
@@ -924,7 +932,11 @@ handle_monitor_event (void *cls,
924 rd_count, 932 rd_count,
925 rd_public); 933 rd_public);
926 if (0 == rd_public_count) 934 if (0 == rd_public_count)
935 {
936 GNUNET_NAMESTORE_zone_monitor_next (zmon,
937 1);
927 return; /* nothing to do */ 938 return; /* nothing to do */
939 }
928 num_public_records++; 940 num_public_records++;
929 ma = GNUNET_new (struct DhtPutActivity); 941 ma = GNUNET_new (struct DhtPutActivity);
930 ma->start_date = GNUNET_TIME_absolute_get (); 942 ma->start_date = GNUNET_TIME_absolute_get ();
@@ -938,6 +950,8 @@ handle_monitor_event (void *cls,
938 { 950 {
939 /* PUT failed, do not remember operation */ 951 /* PUT failed, do not remember operation */
940 GNUNET_free (ma); 952 GNUNET_free (ma);
953 GNUNET_NAMESTORE_zone_monitor_next (zmon,
954 1);
941 return; 955 return;
942 } 956 }
943 GNUNET_CONTAINER_DLL_insert_tail (ma_head, 957 GNUNET_CONTAINER_DLL_insert_tail (ma_head,
@@ -1097,6 +1111,8 @@ run (void *cls,
1097 NULL, 1111 NULL,
1098 &monitor_sync_event, 1112 &monitor_sync_event,
1099 NULL); 1113 NULL);
1114 GNUNET_NAMESTORE_zone_monitor_next (zmon,
1115 NAMESTORE_QUEUE_LIMIT - 1);
1100 GNUNET_break (NULL != zmon); 1116 GNUNET_break (NULL != zmon);
1101 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, 1117 GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
1102 NULL); 1118 NULL);