fix 1698
authorChristian Grothoff <christian@grothoff.org>
Fri, 17 Jun 2011 10:03:36 +0000 (10:03 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 17 Jun 2011 10:03:36 +0000 (10:03 +0000)
src/core/gnunet-service-core.c

index 19758c5b39b55890e60f6231a11787d0b7d52289..a7f6f893997bb0baa1bf94f6959cd9321aec6254 100644 (file)
@@ -2030,6 +2030,11 @@ process_encrypted_neighbour_queue (struct Neighbour *n)
  
   if (n->th != NULL)
     return;  /* request already pending */
+  if (GNUNET_YES != n->is_connected)
+    {
+      GNUNET_break (0);
+      return;
+    }
   m = n->encrypted_head;
   if (m == NULL)
     {
@@ -4522,6 +4527,11 @@ handle_transport_notify_disconnect (void *cls,
       GNUNET_TRANSPORT_notify_transmit_ready_cancel (n->th);
       n->th = NULL;
     }
+  if (GNUNET_SCHEDULER_NO_TASK != n->keep_alive_task)
+    {
+      GNUNET_SCHEDULER_cancel (n->keep_alive_task);
+      n->keep_alive_task = GNUNET_SCHEDULER_NO_TASK;
+    }
   n->is_connected = GNUNET_NO;
   n->status = PEER_STATE_DOWN;
   while (NULL != (car = n->active_client_request_head))