Add support to free/allocate SSL buffers
authorTodd Short <tshort@akamai.com>
Fri, 13 Jan 2017 16:00:26 +0000 (11:00 -0500)
committerRich Salz <rsalz@openssl.org>
Wed, 26 Jul 2017 15:42:17 +0000 (11:42 -0400)
commita58eb06d527c86492d4205feeb0e20bf19a1181d
tree2a637ed40c13437a2a2b219e667276c8c963f183
parent0a3452520fe4cd6871ae8b7c4199c6d5d4efe912
Add support to free/allocate SSL buffers

OpenSSL already has the feature of SSL_MODE_RELEASE_BUFFERS that can
be set to release the read or write buffers when data has finished
reading or writing. OpenSSL will automatically re-allocate the buffers
as needed. This can be quite aggressive in terms of memory allocation.

This provides a manual mechanism. SSL_free_buffers() will free
the data buffers if there's no pending data. SSL_alloc_buffers()
will realloc them; but this function is not strictly necessary, as it's
still done automatically in the state machine.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2240)
doc/man3/SSL_alloc_buffers.pod [new file with mode: 0644]
include/openssl/ssl.h
ssl/ssl_lib.c
test/build.info
test/recipes/90-test_sslbuffers.t [new file with mode: 0644]
test/sslbuffertest.c [new file with mode: 0644]
util/libssl.num