gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r37415 - gnunet/src/statistics


From: gnunet
Subject: [GNUnet-SVN] r37415 - gnunet/src/statistics
Date: Tue, 28 Jun 2016 19:16:47 +0200

Author: grothoff
Date: 2016-06-28 19:16:47 +0200 (Tue, 28 Jun 2016)
New Revision: 37415

Modified:
   gnunet/src/statistics/statistics_api.c
Log:
-ensure stats queues do not grow too big

Modified: gnunet/src/statistics/statistics_api.c
===================================================================
--- gnunet/src/statistics/statistics_api.c      2016-06-28 16:47:42 UTC (rev 
37414)
+++ gnunet/src/statistics/statistics_api.c      2016-06-28 17:16:47 UTC (rev 
37415)
@@ -307,21 +307,21 @@
 
 
 /**
- * Schedule the next action to be performed.
+ * Reconnect at a later time, respecting back-off.
  *
- * @param cls statistics handle to reconnect
+ * @param h statistics handle
  */
 static void
-schedule_action (void *cls);
+reconnect_later (struct GNUNET_STATISTICS_Handle *h);
 
 
 /**
- * Reconnect at a later time, respecting back-off.
+ * Schedule the next action to be performed.
  *
- * @param h statistics handle
+ * @param cls statistics handle to reconnect
  */
 static void
-reconnect_later (struct GNUNET_STATISTICS_Handle *h);
+schedule_action (void *cls);
 
 
 /**
@@ -786,6 +786,9 @@
                                              2,
                                              c->subsystem,
                                              c->name));
+  GNUNET_MQ_notify_sent (env,
+                         &schedule_action,
+                         handle);
   GNUNET_MQ_send (handle->mq,
                   env);
 }
@@ -819,6 +822,9 @@
                                              2,
                                              handle->current->subsystem,
                                              handle->current->name));
+  GNUNET_MQ_notify_sent (env,
+                         &schedule_action,
+                         handle);
   GNUNET_MQ_send (handle->mq,
                   env);
   GNUNET_assert (NULL == handle->current->cont);
@@ -1001,6 +1007,8 @@
     reconnect_later (h);
     return;
   }
+  if (0 < GNUNET_MQ_get_length (h->mq) )
+    return; /* Wait for queue to be reduced more */
   /* schedule next action */
   while (NULL == h->current)
   {
@@ -1018,6 +1026,9 @@
       h->do_destroy = GNUNET_SYSERR; /* in 'TEST' mode */
       env = GNUNET_MQ_msg (hdr,
                            GNUNET_MESSAGE_TYPE_TEST);
+      GNUNET_MQ_notify_sent (env,
+                             &schedule_action,
+                             h);
       GNUNET_MQ_send (h->mq,
                       env);
       return;




reply via email to

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