]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: Make sure I/O input event is triggered after ostream-ssl has read...
authorTimo Sirainen <tss@iki.fi>
Thu, 3 Apr 2014 16:54:27 +0000 (19:54 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 3 Apr 2014 16:54:27 +0000 (19:54 +0300)
src/lib-ssl-iostream/iostream-openssl.c
src/lib-ssl-iostream/iostream-openssl.h
src/lib-ssl-iostream/istream-openssl.c

index 324cc52602118ef273f1a2b8c74b5a4792b57640..6b3dd92186dfc3137614c447051f2213c708d0b8 100644 (file)
@@ -261,6 +261,7 @@ openssl_iostream_create(struct ssl_iostream_context *ctx, const char *host,
        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 @@ static bool openssl_iostream_bio_input(struct ssl_iostream *ssl_io)
                        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;
index 5e9f4c80066b9dff2f27a6c6d78277196cd8f193..5f2870367fe82f98ae1b0cab9920741d0f6be276 100644 (file)
@@ -26,6 +26,7 @@ struct ssl_iostream {
 
        struct istream *plain_input;
        struct ostream *plain_output;
+       struct istream *ssl_input;
        struct ostream *ssl_output;
 
        char *host;
index 7a16253e391643c514a027d59f9a8beebe4a601c..885ce0857b3bf06661cf6b46be88f73d0c7bb5ac 100644 (file)
@@ -24,6 +24,7 @@ static void i_stream_ssl_destroy(struct iostream_private *stream)
        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);
 }