do not auto-reconnect during shutdown:
authorChristian Grothoff <christian@grothoff.org>
Tue, 10 Nov 2009 19:53:09 +0000 (19:53 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 10 Nov 2009 19:53:09 +0000 (19:53 +0000)
src/util/client.c
src/util/connection.c

index 80ea6d644fa6b23b9245e211760db0564b27a123..cb834031c50f7b4db69f7a9db7d86972195f88c0 100644 (file)
@@ -747,13 +747,12 @@ client_notify (void *cls, size_t size, void *buf)
   th->sock->th = NULL;
   if (buf == NULL)
     {
-      // FIXME: need a way to check if the
-      // reason is SHUTDOWN (not timeout) and
-      // if so NOT retry!
       delay = GNUNET_TIME_absolute_get_remaining (th->timeout);
       delay.value /= 2;
-      if ((GNUNET_YES != th->auto_retry) ||
-          (0 == --th->attempts_left) || (delay.value < 1))
+      if ( (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & GNUNET_SCHEDULER_get_reason (th->sched))) ||
+          (GNUNET_YES != th->auto_retry) ||
+          (0 == --th->attempts_left) || 
+          (delay.value < 1) )
         {
 #if DEBUG_CLIENT
           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
index e09c0cd9eec00b8e7903dff30358d32e5edd77b3..993a3c7832dd2af96e0128331e230ab211b0adab 100644 (file)
@@ -543,7 +543,6 @@ connect_fail_continuation (struct GNUNET_CONNECTION_Handle *h)
   GNUNET_break (h->dns_active == GNUNET_NO);
   GNUNET_break (h->sock == NULL);
 
-  /* FIXME: trigger delayed reconnect attempt... */
   /* trigger jobs that used to wait on "connect_task" */
   if (0 != (h->ccs & COCO_RECEIVE_AGAIN))
     {