dovecot-2.2: lib-ssl-iostream: Close the plain iostreams when ss...

dovecot at dovecot.org dovecot at dovecot.org
Fri Nov 14 22:31:24 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/2d87ec863b76
changeset: 18091:2d87ec863b76
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Nov 15 00:27:27 2014 +0200
description:
lib-ssl-iostream: Close the plain iostreams when ssl-iostream is destroyed.

diffstat:

 src/lib-ssl-iostream/iostream-openssl.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r 77638cc62ca8 -r 2d87ec863b76 src/lib-ssl-iostream/iostream-openssl.c
--- a/src/lib-ssl-iostream/iostream-openssl.c	Sat Nov 15 00:14:20 2014 +0200
+++ b/src/lib-ssl-iostream/iostream-openssl.c	Sat Nov 15 00:27:27 2014 +0200
@@ -294,6 +294,10 @@
 	(void)SSL_shutdown(ssl_io->ssl);
 	(void)openssl_iostream_more(ssl_io);
 	(void)o_stream_flush(ssl_io->plain_output);
+	/* close the plain i/o streams, because their fd may be closed soon,
+	   but we may still keep this ssl-iostream referenced until later. */
+	i_stream_close(ssl_io->plain_input);
+	o_stream_close(ssl_io->plain_output);
 
 	ssl_iostream_unref(&ssl_io);
 }


More information about the dovecot-cvs mailing list