From 4de2a17e0a2aed3b57a6c1057329b6a132b56ae2 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 9 Oct 2009 21:32:04 -0400 Subject: [PATCH] *-login: Close auth client connection after (proxying) process no longer needs it. --HG-- branch : HEAD --- src/login-common/client-common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/login-common/client-common.c b/src/login-common/client-common.c index 7a797087ee..cc2ade78e3 100644 --- a/src/login-common/client-common.c +++ b/src/login-common/client-common.c @@ -157,7 +157,14 @@ void client_destroy(struct client *client, const char *reason) if (client->ssl_proxy != NULL) ssl_proxy_free(&client->ssl_proxy); client->v.destroy(client); - client_unref(&client); + if (client_unref(&client) && + master_service_get_service_count(master_service) == 1) { + /* as soon as this connection is done with proxying + (or whatever), the process will die. there's no need for + authentication anymore, so close the connection. */ + if (auth_client != NULL) + auth_client_deinit(&auth_client); + } } void client_destroy_success(struct client *client, const char *reason) -- 2.47.3