summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_ssl_openssl.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-07-06 19:07:30 +0200
committerAttila Molnar <attilamolnar@hush.com>2015-07-06 19:07:30 +0200
commit6447b7be822439cce2f8109ea5362edeec4c6255 (patch)
tree9fe89d029f92c22ebd60b6bf08518bee4cc1af30 /src/modules/extra/m_ssl_openssl.cpp
parent72555992d16af9a1ca28ada1dc70591fb7653dfe (diff)
m_ssl_openssl Use SSL_MODE_RELEASE_BUFFERS if available
Diffstat (limited to 'src/modules/extra/m_ssl_openssl.cpp')
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 684ee2180..6d3eef393 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -126,7 +126,12 @@ namespace OpenSSL
#endif
ctx_options = SSL_CTX_set_options(ctx, opts);
- SSL_CTX_set_mode(ctx, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+
+ long mode = SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
+#ifdef SSL_MODE_RELEASE_BUFFERS
+ mode |= SSL_MODE_RELEASE_BUFFERS;
+#endif
+ SSL_CTX_set_mode(ctx, mode);
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, OnVerify);
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
SSL_CTX_set_info_callback(ctx, StaticSSLInfoCallback);