]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: ostream-ssl - Add ssl_io helper variable
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 24 Sep 2021 16:15:22 +0000 (19:15 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 30 Sep 2021 17:08:11 +0000 (17:08 +0000)
src/lib-ssl-iostream/ostream-openssl.c

index a696056581bbb8cc14ff8879b3b2f938cc1aa001..68ddcf3afa12b8449db2948fe5b9335a05adde0e 100644 (file)
@@ -144,14 +144,15 @@ static int o_stream_ssl_flush_buffer(struct ssl_ostream *sstream)
 static int o_stream_ssl_flush(struct ostream_private *stream)
 {
        struct ssl_ostream *sstream = (struct ssl_ostream *)stream;
-       struct ostream *plain_output = sstream->ssl_io->plain_output;
+       struct ssl_iostream *ssl_io = sstream->ssl_io;
+       struct ostream *plain_output = ssl_io->plain_output;
        int ret;
 
-       if ((ret = openssl_iostream_more(sstream->ssl_io,
+       if ((ret = openssl_iostream_more(ssl_io,
                                OPENSSL_IOSTREAM_SYNC_TYPE_HANDSHAKE)) < 0) {
                /* handshake failed */
                io_stream_set_error(&stream->iostream, "%s",
-                                   sstream->ssl_io->last_error);
+                                   ssl_io->last_error);
                stream->ostream.stream_errno = errno;
        } else if (ret > 0 && sstream->buffer != NULL &&
                   sstream->buffer->used > 0) {
@@ -159,10 +160,10 @@ static int o_stream_ssl_flush(struct ostream_private *stream)
                ret = o_stream_ssl_flush_buffer(sstream);
        }
 
-       if (ret == 0 && sstream->ssl_io->want_read) {
+       if (ret == 0 && ssl_io->want_read) {
                /* we need to read more data until we can continue. */
                o_stream_set_flush_pending(plain_output, FALSE);
-               sstream->ssl_io->ostream_flush_waiting_input = TRUE;
+               ssl_io->ostream_flush_waiting_input = TRUE;
                ret = 1;
        }