]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
*-login: Close auth client connection after (proxying) process no longer needs it.
authorTimo Sirainen <tss@iki.fi>
Sat, 10 Oct 2009 01:32:04 +0000 (21:32 -0400)
committerTimo Sirainen <tss@iki.fi>
Sat, 10 Oct 2009 01:32:04 +0000 (21:32 -0400)
--HG--
branch : HEAD

src/login-common/client-common.c

index 7a797087eee79609508cbd58b4f9f09edea0793a..cc2ade78e306316a4a57a2c8638ad3143f16914f 100644 (file)
@@ -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)