From: Timo Sirainen Date: Thu, 10 Dec 2009 01:28:54 +0000 (-0500) Subject: *-login: If we've a pending shutdown and auth connection gets lost, kill clients. X-Git-Tag: 2.0.beta1~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56309ccb7a3a705f4ae264badc3b085e11269eb9;p=thirdparty%2Fdovecot%2Fcore.git *-login: If we've a pending shutdown and auth connection gets lost, kill clients. If master and auth processes had died, we would never get another connection. --HG-- branch : HEAD --- diff --git a/src/login-common/main.c b/src/login-common/main.c index 601327e03e..0b5104f424 100644 --- a/src/login-common/main.c +++ b/src/login-common/main.c @@ -27,6 +27,7 @@ struct anvil_client *anvil; const struct login_settings *global_login_settings; void **global_other_settings; +static bool shutting_down = FALSE; static bool ssl_connections = FALSE; void login_refresh_proctitle(void) @@ -52,7 +53,13 @@ void login_refresh_proctitle(void) static void login_die(void) { + shutting_down = TRUE; login_proxy_kill_idle(); + + if (auth_client == NULL || !auth_client_is_connected(auth_client)) { + /* we don't have auth client, and we might never get one */ + clients_destroy_all(); + } } static void client_connected(const struct master_service_connection *conn) @@ -102,7 +109,9 @@ static void auth_connect_notify(struct auth_client *client ATTR_UNUSED, bool connected, void *context ATTR_UNUSED) { if (connected) - clients_notify_auth_connected(); + clients_notify_auth_connected(); + else if (shutting_down) + clients_destroy_all(); } static bool anvil_reconnect_callback(void)