dovecot-2.2: lib-ssl-iostream: Make sure I/O input event is trig...

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 3 16:55:06 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/e0a3b902cd3f
changeset: 17190:e0a3b902cd3f
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 03 19:54:27 2014 +0300
description:
lib-ssl-iostream: Make sure I/O input event is triggered after ostream-ssl has read some data to buffer.

diffstat:

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

diffs (41 lines):

diff -r b1a756176ed2 -r e0a3b902cd3f src/lib-ssl-iostream/iostream-openssl.c
--- a/src/lib-ssl-iostream/iostream-openssl.c	Thu Apr 03 19:53:13 2014 +0300
+++ b/src/lib-ssl-iostream/iostream-openssl.c	Thu Apr 03 19:54:27 2014 +0300
@@ -261,6 +261,7 @@
 	if (ssl_io->plain_output->real_stream->error_handling_disabled)
 		o_stream_set_no_error_handling(*output, TRUE);
 
+	ssl_io->ssl_input = *input;
 	ssl_io->ssl_output = *output;
 	*iostream_r = ssl_io;
 	return 0;
@@ -427,6 +428,7 @@
 			ssl_io->ostream_flush_waiting_input = FALSE;
 			o_stream_set_flush_pending(ssl_io->plain_output, TRUE);
 		}
+		i_stream_set_input_pending(ssl_io->ssl_input, TRUE);
 		ssl_io->want_read = FALSE;
 	}
 	return bytes_read;
diff -r b1a756176ed2 -r e0a3b902cd3f src/lib-ssl-iostream/iostream-openssl.h
--- a/src/lib-ssl-iostream/iostream-openssl.h	Thu Apr 03 19:53:13 2014 +0300
+++ b/src/lib-ssl-iostream/iostream-openssl.h	Thu Apr 03 19:54:27 2014 +0300
@@ -26,6 +26,7 @@
 
 	struct istream *plain_input;
 	struct ostream *plain_output;
+	struct istream *ssl_input;
 	struct ostream *ssl_output;
 
 	char *host;
diff -r b1a756176ed2 -r e0a3b902cd3f src/lib-ssl-iostream/istream-openssl.c
--- a/src/lib-ssl-iostream/istream-openssl.c	Thu Apr 03 19:53:13 2014 +0300
+++ b/src/lib-ssl-iostream/istream-openssl.c	Thu Apr 03 19:54:27 2014 +0300
@@ -24,6 +24,7 @@
 	struct ssl_istream *sstream = (struct ssl_istream *)stream;
 
 	i_free(sstream->istream.w_buffer);
+	sstream->ssl_io->ssl_input = NULL;
 	ssl_iostream_unref(&sstream->ssl_io);
 }
 


More information about the dovecot-cvs mailing list