dovecot-2.0: *-login: Close auth client connection after (proxyi...

dovecot at dovecot.org dovecot at dovecot.org
Sat Oct 10 04:32:12 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/cf376fcbd6ff
changeset: 10034:cf376fcbd6ff
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Oct 09 21:32:04 2009 -0400
description:
*-login: Close auth client connection after (proxying) process no longer needs it.

diffstat:

1 file changed, 8 insertions(+), 1 deletion(-)
src/login-common/client-common.c |    9 ++++++++-

diffs (19 lines):

diff -r 40a71105529b -r cf376fcbd6ff src/login-common/client-common.c
--- a/src/login-common/client-common.c	Fri Oct 09 21:25:27 2009 -0400
+++ b/src/login-common/client-common.c	Fri Oct 09 21:32:04 2009 -0400
@@ -157,7 +157,14 @@ void client_destroy(struct client *clien
 	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)


More information about the dovecot-cvs mailing list