dovecot-2.2: *-login: Flush SSL output when logging out.

dovecot at dovecot.org dovecot at dovecot.org
Thu Jun 5 08:31:37 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/09d3c9c6f0ad
changeset: 17437:09d3c9c6f0ad
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jun 05 11:30:19 2014 +0300
description:
*-login: Flush SSL output when logging out.
The BYE and LOGOUT replies weren't being sent when they were sent from
imap-login process (before logging in).

diffstat:

 src/login-common/client-common.c     |  1 +
 src/login-common/ssl-proxy-openssl.c |  9 +++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diffs (34 lines):

diff -r 304d545927d2 -r 09d3c9c6f0ad src/login-common/client-common.c
--- a/src/login-common/client-common.c	Wed Jun 04 00:35:27 2014 +0300
+++ b/src/login-common/client-common.c	Thu Jun 05 11:30:19 2014 +0300
@@ -172,6 +172,7 @@
 		last_client = client->prev;
 	DLLIST_REMOVE(&clients, client);
 
+	o_stream_uncork(client->output);
 	if (!client->login_success && client->ssl_proxy != NULL)
 		ssl_proxy_destroy(client->ssl_proxy);
 	if (client->input != NULL)
diff -r 304d545927d2 -r 09d3c9c6f0ad src/login-common/ssl-proxy-openssl.c
--- a/src/login-common/ssl-proxy-openssl.c	Wed Jun 04 00:35:27 2014 +0300
+++ b/src/login-common/ssl-proxy-openssl.c	Thu Jun 05 11:30:19 2014 +0300
@@ -806,10 +806,19 @@
 	i_free(proxy);
 }
 
+static void ssl_proxy_flush(struct ssl_proxy *proxy)
+{
+	/* this is pretty kludgy. mainly this is just for flushing the final
+	   LOGOUT command output. */
+	plain_read(proxy);
+	ssl_step(proxy);
+}
+
 void ssl_proxy_destroy(struct ssl_proxy *proxy)
 {
 	if (proxy->destroyed)
 		return;
+	ssl_proxy_flush(proxy);
 	proxy->destroyed = TRUE;
 
 	ssl_proxy_count--;


More information about the dovecot-cvs mailing list