clean up address probes during destroy as well
authorChristian Grothoff <christian@grothoff.org>
Sun, 15 Nov 2009 17:45:26 +0000 (17:45 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 15 Nov 2009 17:45:26 +0000 (17:45 +0000)
src/util/connection.c
src/util/server.c

index 468fb750c7372de6de71fab46e5cf8c0e545f216..16ec8dcead8b245a9508076b0740e54b02ed8062 100644 (file)
@@ -452,6 +452,7 @@ destroy_continuation (void *cls,
 {
   struct GNUNET_CONNECTION_Handle *sock = cls;
   GNUNET_CONNECTION_TransmitReadyNotify notify;
+  struct AddressProbe *pos;
 
   GNUNET_assert (sock->dns_active == NULL);
   if (0 != (sock->ccs & COCO_TRANSMIT_READY))
@@ -503,6 +504,13 @@ destroy_continuation (void *cls,
       GNUNET_RESOLVER_request_cancel (sock->dns_active);
       sock->dns_active = NULL;
     }
+  while (NULL != (pos = sock->ap_head))
+    {
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (pos->sock));
+      GNUNET_SCHEDULER_cancel (sock->sched, pos->task);
+      GNUNET_CONTAINER_DLL_remove (sock->ap_head, sock->ap_tail, pos);
+      GNUNET_free (pos);
+    }
   GNUNET_assert (sock->nth.timeout_task == GNUNET_SCHEDULER_NO_TASK);
   GNUNET_assert (sock->ccs == COCO_NONE);
   if (NULL != (notify = sock->nth.notify_ready))
index e79a824ba5b839575b01649b27ee209b0e879d96..f918ea4ea030ea187f7418a68941d7f69f421e55 100644 (file)
@@ -298,9 +298,10 @@ process_listen_socket (void *cls,
                   "Server accepted incoming connection.\n");
 #endif
       client = GNUNET_SERVER_connect_socket (server, sock);
+      // GNUNET_CONNECTION_ignore_shutdown (sock, GNUNET_YES);
       /* decrement reference count, we don't keep "client" alive */
       GNUNET_SERVER_client_drop (client);
-    }
+    }  
   /* listen for more! */
   server->listen_task = GNUNET_SCHEDULER_add_select (server->sched,
                                                      GNUNET_SCHEDULER_PRIORITY_HIGH,