833828
833828
# HG changeset patch
833828
# User Timo Sirainen <tss@iki.fi>
833828
# Date 1399472781 -10800
833828
# Node ID 41622541a7a3a938895b5fe045bbc633a9b6c022
833828
# Parent  7a08a481c133be4b8cb8415feaed1321d560cee5
833828
*-login: SSL connections didn't get closed when the client got destroyed.
833828
833828
diff -r 7a08a481c133 -r 41622541a7a3 src/login-common/client-common.c
833828
--- a/src/login-common/client-common.c	Wed May 07 17:12:19 2014 +0300
833828
+++ b/src/login-common/client-common.c	Wed May 07 17:26:21 2014 +0300
833828
@@ -171,6 +171,8 @@
833828
 		last_client = client->prev;
833828
 	DLLIST_REMOVE(&clients, client);
833828
 
833828
+	if (!client->login_success && client->ssl_proxy != NULL)
833828
+		ssl_proxy_destroy(client->ssl_proxy);
833828
 	if (client->input != NULL)
833828
 		i_stream_close(client->input);
833828
 	if (client->output != NULL)
833828
diff -r 7a08a481c133 -r 41622541a7a3 src/login-common/ssl-proxy-openssl.c
833828
--- a/src/login-common/ssl-proxy-openssl.c	Wed May 07 17:12:19 2014 +0300
833828
+++ b/src/login-common/ssl-proxy-openssl.c	Wed May 07 17:26:21 2014 +0300
833828
@@ -116,7 +116,6 @@
833828
 static void ssl_read(struct ssl_proxy *proxy);
833828
 static void ssl_write(struct ssl_proxy *proxy);
833828
 static void ssl_step(struct ssl_proxy *proxy);
833828
-static void ssl_proxy_destroy(struct ssl_proxy *proxy);
833828
 static void ssl_proxy_unref(struct ssl_proxy *proxy);
833828
 
833828
 static struct ssl_server_context *
833828
@@ -807,7 +806,7 @@
833828
 	i_free(proxy);
833828
 }
833828
 
833828
-static void ssl_proxy_destroy(struct ssl_proxy *proxy)
833828
+void ssl_proxy_destroy(struct ssl_proxy *proxy)
833828
 {
833828
 	if (proxy->destroyed)
833828
 		return;
833828
diff -r 7a08a481c133 -r 41622541a7a3 src/login-common/ssl-proxy.h
833828
--- a/src/login-common/ssl-proxy.h	Wed May 07 17:12:19 2014 +0300
833828
+++ b/src/login-common/ssl-proxy.h	Wed May 07 17:26:21 2014 +0300
833828
@@ -34,6 +34,7 @@
833828
 const char *ssl_proxy_get_security_string(struct ssl_proxy *proxy);
833828
 const char *ssl_proxy_get_compression(struct ssl_proxy *proxy);
833828
 const char *ssl_proxy_get_cert_error(struct ssl_proxy *proxy);
833828
+void ssl_proxy_destroy(struct ssl_proxy *proxy);
833828
 void ssl_proxy_free(struct ssl_proxy **proxy);
833828
 
833828
 /* Return number of active SSL proxies */
833828