From: Christian Grothoff Date: Sun, 15 Nov 2009 17:45:26 +0000 (+0000) Subject: clean up address probes during destroy as well X-Git-Tag: initial-import-from-subversion-38251~23076 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=be9e0f23d0e24c093597e342024f29b0111f7f9b;p=oweals%2Fgnunet.git clean up address probes during destroy as well --- diff --git a/src/util/connection.c b/src/util/connection.c index 468fb750c..16ec8dcea 100644 --- a/src/util/connection.c +++ b/src/util/connection.c @@ -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)) diff --git a/src/util/server.c b/src/util/server.c index e79a824ba..f918ea4ea 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -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,