fix
authorChristian Grothoff <christian@grothoff.org>
Sun, 5 Jun 2011 13:25:21 +0000 (13:25 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 5 Jun 2011 13:25:21 +0000 (13:25 +0000)
src/transport/transport_api_new.c

index 6d508f0f889f5b985b1331c87913693512fe4c18..1018cff3159f68218dc6eed086f31e49f9a183ff 100644 (file)
@@ -1340,13 +1340,14 @@ GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle)
              "Transport disconnect called!\n");
 #endif
   /* this disconnects all neighbours... */
-  disconnect_and_schedule_reconnect (handle);
+  if (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK)
+    disconnect_and_schedule_reconnect (handle);
   /* and now we stop trying to connect again... */
   if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
     {
       GNUNET_SCHEDULER_cancel (handle->reconnect_task);
       handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
-    }
+    }  
   GNUNET_CONTAINER_multihashmap_destroy (handle->neighbours);
   handle->neighbours = NULL;
   if (handle->quota_task != GNUNET_SCHEDULER_NO_TASK)