stuff
[oweals/gnunet.git] / src / util / server_nc.c
index 05a4913a88dfcfa96a660bd19fac437e7bc810f4..88de62c63f4a20a1b1cb9112ca1825b1969912f1 100644 (file)
@@ -172,6 +172,11 @@ handle_client_disconnect (void *cls,
       GNUNET_free (pml);
     }
   GNUNET_SERVER_client_drop (client);
+  if (pos->th != NULL)
+    {
+      GNUNET_CONNECTION_notify_transmit_ready_cancel (pos->th);
+      pos->th = NULL;
+    }
   GNUNET_free (pos);
 }
 
@@ -215,8 +220,8 @@ GNUNET_SERVER_notification_context_destroy (struct GNUNET_SERVER_NotificationCon
   while (NULL != (pos = nc->clients))
     {
       nc->clients = pos->next;
-      GNUNET_SERVER_receive_done (pos->client, GNUNET_NO);
       GNUNET_SERVER_client_drop (pos->client); 
+      GNUNET_SERVER_receive_done (pos->client, GNUNET_NO);
       while (NULL != (pml = pos->pending_head))
        {
          pos->pending_head = pml->next;