gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r15386 - gnunet/src/core


From: gnunet
Subject: [GNUnet-SVN] r15386 - gnunet/src/core
Date: Wed, 1 Jun 2011 17:28:40 +0200

Author: grothoff
Date: 2011-06-01 17:28:40 +0200 (Wed, 01 Jun 2011)
New Revision: 15386

Modified:
   gnunet/src/core/core_api.c
Log:
fix

Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c  2011-06-01 14:15:04 UTC (rev 15385)
+++ gnunet/src/core/core_api.c  2011-06-01 15:28:40 UTC (rev 15386)
@@ -488,6 +488,17 @@
   struct PeerRecord *pr;
 
   GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK);
+  while (NULL != (cm = h->control_pending_head))
+    {
+      GNUNET_CONTAINER_DLL_remove (h->control_pending_head,
+                                  h->control_pending_tail,
+                                  cm);
+      if (cm->th != NULL)
+       cm->th->cm = NULL; 
+      if (cm->cont != NULL)
+       cm->cont (cm->cont_cls, GNUNET_NO);
+      GNUNET_free (cm);
+    }
   if (h->client != NULL)
     {
       GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
@@ -505,17 +516,6 @@
   h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->retry_backoff,
                                                    &reconnect_task,
                                                    h);
-  while (NULL != (cm = h->control_pending_head))
-    {
-      GNUNET_CONTAINER_DLL_remove (h->control_pending_head,
-                                  h->control_pending_tail,
-                                  cm);
-      if (cm->th != NULL)
-       cm->th->cm = NULL; 
-      if (cm->cont != NULL)
-       cm->cont (cm->cont_cls, GNUNET_NO);
-      GNUNET_free (cm);
-    }
   GNUNET_assert (h->control_pending_head == NULL);
   h->retry_backoff = GNUNET_TIME_relative_min (GNUNET_TIME_UNIT_SECONDS,
                                               h->retry_backoff);
@@ -1486,11 +1486,6 @@
       GNUNET_CLIENT_notify_transmit_ready_cancel (handle->cth);
       handle->cth = NULL;
     }
-  if (handle->client != NULL)
-    {
-      GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO);
-      handle->client = NULL;
-    }
   while (NULL != (cm = handle->control_pending_head))
     {
       GNUNET_CONTAINER_DLL_remove (handle->control_pending_head,
@@ -1502,6 +1497,11 @@
        cm->cont (cm->cont_cls, GNUNET_SYSERR);
       GNUNET_free (cm);
     }
+  if (handle->client != NULL)
+    {
+      GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO);
+      handle->client = NULL;
+    }
   if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
     {
       GNUNET_SCHEDULER_cancel (handle->reconnect_task);




reply via email to

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