gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r20285 - gnunet/src/statistics
Date: Mon, 5 Mar 2012 18:40:00 +0100

Author: bartpolot
Date: 2012-03-05 18:40:00 +0100 (Mon, 05 Mar 2012)
New Revision: 20285

Modified:
   gnunet/src/statistics/statistics_api.c
Log:
- Fix for #2177: don't wait forever to reconnect to the service during 
shutdown. In fact, don't wait at all.

Modified: gnunet/src/statistics/statistics_api.c
===================================================================
--- gnunet/src/statistics/statistics_api.c      2012-03-05 17:31:35 UTC (rev 
20284)
+++ gnunet/src/statistics/statistics_api.c      2012-03-05 17:40:00 UTC (rev 
20285)
@@ -416,6 +416,18 @@
 reconnect_later (struct GNUNET_STATISTICS_Handle *h)
 {
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->backoff_task);
+  if (h->do_destroy)
+  {
+    /* So we are shutting down and the service is not reachable.
+     * Chances are that it's down for good and we are not going to connect to
+     * it anymore.
+     * Give up and don't sync the rest of the data.
+     */
+    GNUNET_break (0);
+    h->do_destroy = GNUNET_NO;
+    GNUNET_STATISTICS_destroy (h, GNUNET_NO);
+    return;
+  }
   h->backoff_task =
     GNUNET_SCHEDULER_add_delayed (h->backoff, &reconnect_task, h);
   h->backoff = GNUNET_TIME_relative_multiply (h->backoff, 2);
@@ -837,6 +849,7 @@
 
   if (h == NULL)
     return;
+  GNUNET_assert (GNUNET_NO == h->do_destroy); // Don't call twice.
   if (GNUNET_SCHEDULER_NO_TASK != h->backoff_task)
   {
     GNUNET_SCHEDULER_cancel (h->backoff_task);




reply via email to

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