# HG changeset patch
# User Timo Sirainen <tss@iki.fi>
# Date 1401957019 -10800
# Node ID 09d3c9c6f0ad473e0114edac67d4ec43cf7255bd
# Parent 304d545927d25ea352ac596b7d7ce2e96468fe2e
*-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).
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--;