add comment to explain
authorNathan S. Evans <evans@in.tum.de>
Tue, 30 Nov 2010 17:06:01 +0000 (17:06 +0000)
committerNathan S. Evans <evans@in.tum.de>
Tue, 30 Nov 2010 17:06:01 +0000 (17:06 +0000)
src/core/gnunet-service-core.c

index 53eee200090a4ed5d0b8fc1b974399bae72f6a46..f6b96a13e890b71be91b1cd114de96516934db47 100644 (file)
@@ -4407,11 +4407,14 @@ handle_transport_notify_disconnect (void *cls,
       cnm.peer = *peer;
       send_to_all_clients (&cnm.header, GNUNET_NO, GNUNET_CORE_OPTION_SEND_DISCONNECT);
     }
-  if (NULL != n->th)
+
+  /* On transport disconnect transport doesn't cancel requests, so must do so here. */
+  if (n->th != NULL)
     {
-      GNUNET_TRANSPORT_notify_transmit_ready_cancel (n->th);
-      n->th = NULL;
+      GNUNET_TRANSPORT_notify_transmit_ready_cancel(n->th);
     }
+  n->th = NULL;
+
   n->is_connected = GNUNET_NO;
   n->status = PEER_STATE_DOWN;
   while (NULL != (car = n->active_client_request_head))