aboutsummaryrefslogtreecommitdiff
path: root/src/zonemaster/gnunet-service-zonemaster.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-10-25 23:58:54 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-10-25 23:58:54 +0900
commit5d116312a08aa5b76fc0075fb9a244487dd1fb68 (patch)
tree58b35b2c6bb869443e6a9ed38f6177bd9364393a /src/zonemaster/gnunet-service-zonemaster.c
parent34dd119251f9806a4f83de4d405e654dc6b1bf76 (diff)
downloadgnunet-5d116312a08aa5b76fc0075fb9a244487dd1fb68.tar.gz
gnunet-5d116312a08aa5b76fc0075fb9a244487dd1fb68.zip
-unblock both iterators when queue is getting emptied
Diffstat (limited to 'src/zonemaster/gnunet-service-zonemaster.c')
-rw-r--r--src/zonemaster/gnunet-service-zonemaster.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c
index b0e8dc29c..09053a676 100644
--- a/src/zonemaster/gnunet-service-zonemaster.c
+++ b/src/zonemaster/gnunet-service-zonemaster.c
@@ -202,10 +202,6 @@ struct DhtPutActivity
202 */ 202 */
203 struct GNUNET_TIME_Absolute start_date; 203 struct GNUNET_TIME_Absolute start_date;
204 204
205 /**
206 * Zone monitor
207 */
208 struct GNUNET_NAMESTORE_ZoneMonitor *zm;
209}; 205};
210 206
211/** 207/**
@@ -772,13 +768,13 @@ dht_put_continuation (void *cls)
772 768
773 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 769 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
774 "PUT complete\n"); 770 "PUT complete\n");
775 /* When we just fall under the limit, trigger monitor or iterator again */ 771 /* When we just fall under the limit, trigger monitor/iterator again
772 * creating a race condition, but we may actually have finished more
773 * PUTs by the time they come back and both can carry on */
776 if (dht_queue_length == DHT_QUEUE_LIMIT) 774 if (dht_queue_length == DHT_QUEUE_LIMIT)
777 { 775 {
778 if (NULL != ma->zm) 776 GNUNET_NAMESTORE_zone_monitor_next (zmon, 1);
779 GNUNET_NAMESTORE_zone_monitor_next (ma->zm, 1); 777 GNUNET_NAMESTORE_zone_iterator_next (namestore_iter, 1);
780 else
781 GNUNET_NAMESTORE_zone_iterator_next (namestore_iter, 1);
782 } 778 }
783 dht_queue_length--; 779 dht_queue_length--;
784 GNUNET_CONTAINER_DLL_remove (it_head, 780 GNUNET_CONTAINER_DLL_remove (it_head,
@@ -1244,7 +1240,6 @@ handle_monitor_event (void *cls,
1244 return; 1240 return;
1245 } 1241 }
1246 ma = GNUNET_new (struct DhtPutActivity); 1242 ma = GNUNET_new (struct DhtPutActivity);
1247 ma->zm = zmon;
1248 perform_dht_put_monitor (zone, 1243 perform_dht_put_monitor (zone,
1249 label, 1244 label,
1250 rd, 1245 rd,