0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 12:12:15 +02:00

OpenSSL: set SSL_MODE_RELEASE_BUFFERS to conserve memory by releasing unneeded buffers

SSL_MODE_RELEASE_BUFFERS will free buffers that are fully drained
and re-allocate them as needed.  Testing with proto.cpp suggests
that this doesn't negatively affect performance.

Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
James Yonan 2018-02-18 22:23:14 -07:00 committed by Antonio Quartulli
parent 32e3ea117c
commit 846ed217df
No known key found for this signature in database
GPG Key ID: 07A53C580EF2CD74

View File

@ -522,6 +522,9 @@ namespace openvpn {
if (!ssl) if (!ssl)
throw OpenSSLException("OpenSSLContext::SSL: SSL_new failed"); throw OpenSSLException("OpenSSLContext::SSL: SSL_new failed");
// release unneeded buffers
SSL_set_mode(ssl, SSL_MODE_RELEASE_BUFFERS);
// verify hostname // verify hostname
if (hostname) if (hostname)
{ {