From 4702aa0b473896d74c7eae313cc0e5547606acd8 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Wed, 19 Jan 2000 22:03:58 +0000 Subject: [PATCH] detach from view early in client destruction so that the resolver can start shutting down immediately instead of only after recursions in progress have finished --- bin/named/client.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/named/client.c b/bin/named/client.c index 8ffbd8e62f..940968c56e 100644 --- a/bin/named/client.c +++ b/bin/named/client.c @@ -139,6 +139,14 @@ maybe_free(ns_client_t *client) { isc_socket_cancel(socket, client->task, ISC_SOCKCANCEL_SEND); } + /* + * We need to detach from the view early, because when shutting + * down the server, resolver shutdown does not begin until + * happen until the view refcount goes to zero. + */ + if (client->view != NULL) + dns_view_detach(&client->view); + if (!(client->nreads == 0 && client->naccepts == 0 && client->nsends == 0 && client->nwaiting == 0)) { /* Still waiting for events. */ @@ -162,8 +170,6 @@ maybe_free(ns_client_t *client) { &client->dispentry, deventp); } - if (client->view != NULL) - dns_view_detach(&client->view); if (client->opt != NULL) { INSIST(dns_rdataset_isassociated(client->opt)); dns_rdataset_disassociate(client->opt);