]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: Enable partial writes and moving buffers
authorAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 20 Jun 2018 05:52:52 +0000 (08:52 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 20 Jun 2018 07:36:39 +0000 (07:36 +0000)
Dovecot is able to provide same content to SSL_write, and
can also take care of consuming written data from the buffer.

Fixes SSL_write failed:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry

src/lib-ssl-iostream/iostream-openssl-context.c

index 326f14975bbcfc4f1e41224ef7d76f8a8af37ffb..befc555b40f9057ef15392f55028a0395f6e6720 100644 (file)
@@ -592,6 +592,12 @@ ssl_iostream_context_init_common(struct ssl_iostream_context *ctx,
        SSL_CTX_set_options(ctx->ssl_ctx, ssl_ops);
 #ifdef SSL_MODE_RELEASE_BUFFERS
        SSL_CTX_set_mode(ctx->ssl_ctx, SSL_MODE_RELEASE_BUFFERS);
+#endif
+#ifdef SSL_MODE_ENABLE_PARTIAL_WRITE
+       SSL_CTX_set_mode(ctx->ssl_ctx, SSL_MODE_ENABLE_PARTIAL_WRITE);
+#endif
+#ifdef SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
+       SSL_CTX_set_mode(ctx->ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
 #endif
        if (ssl_proxy_ctx_set_crypto_params(ctx->ssl_ctx, set, error_r) < 0)
                return -1;