gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: also limit ma DHT puts


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: also limit ma DHT puts
Date: Mon, 30 Apr 2018 18:58:57 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 4e8ed0705 also limit ma DHT puts
4e8ed0705 is described below

commit 4e8ed070519a3e51255586f6d8282972a1c08987
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Apr 30 18:58:55 2018 +0200

    also limit ma DHT puts
---
 src/zonemaster/gnunet-service-zonemaster.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/zonemaster/gnunet-service-zonemaster.c 
b/src/zonemaster/gnunet-service-zonemaster.c
index 3be822529..324eb3b5d 100644
--- a/src/zonemaster/gnunet-service-zonemaster.c
+++ b/src/zonemaster/gnunet-service-zonemaster.c
@@ -172,11 +172,16 @@ static struct DhtPutActivity *it_head;
 static struct DhtPutActivity *it_tail;
 
 /**
- * Number of entries in the DHT queue.
+ * Number of entries in the DHT queue #it_head.
  */
 static unsigned int dht_queue_length;
 
 /**
+ * Number of entries in the DHT queue #ma_head.
+ */
+static unsigned int ma_queue_length;
+
+/**
  * Useful for zone update for DHT put
  */
 static unsigned long long num_public_records;
@@ -369,7 +374,7 @@ dht_put_monitor_continuation (void *cls)
 {
   struct DhtPutActivity *ma = cls;
 
-  num_public_records++;
+  ma_queue_length--;
   GNUNET_CONTAINER_DLL_remove (ma_head,
                                ma_tail,
                                ma);
@@ -911,6 +916,7 @@ handle_monitor_event (void *cls,
                                                 rd_public);
   if (0 == rd_public_count)
     return; /* nothing to do */
+  num_public_records++;
   ma = GNUNET_new (struct DhtPutActivity);
   ma->start_date = GNUNET_TIME_absolute_get ();
   ma->ph = perform_dht_put (zone,
@@ -928,6 +934,21 @@ handle_monitor_event (void *cls,
   GNUNET_CONTAINER_DLL_insert (ma_head,
                                ma_tail,
                                ma);
+  ma_queue_length++;
+  if (ma_queue_length > DHT_QUEUE_LIMIT)
+  {
+    ma = it_head;
+    GNUNET_CONTAINER_DLL_remove (ma_head,
+                                 ma_tail,
+                                 ma);
+    GNUNET_DHT_put_cancel (ma->ph);
+    ma_queue_length--;
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "DHT PUT unconfirmed after %s, aborting PUT\n",
+                GNUNET_STRINGS_relative_time_to_string 
(GNUNET_TIME_absolute_get_duration (ma->start_date),
+                                                        GNUNET_YES));
+    GNUNET_free (ma);
+  }
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]