aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTodd Short <tshort@akamai.com>2017-01-13 11:00:26 -0500
committerRich Salz <rsalz@openssl.org>2017-07-26 11:42:17 -0400
commita58eb06d527c86492d4205feeb0e20bf19a1181d (patch)
tree2a637ed40c13437a2a2b219e667276c8c963f183 /include
parent0a3452520fe4cd6871ae8b7c4199c6d5d4efe912 (diff)
downloadopenssl-a58eb06d527c86492d4205feeb0e20bf19a1181d.tar.gz
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)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/ssl.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index 5dd210d580..c6349378c3 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -442,8 +442,7 @@ typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx);
# define SSL_MODE_NO_AUTO_CHAIN 0x00000008U
/*
* Save RAM by releasing read and write buffers when they're empty. (SSL3 and
- * TLS only.) "Released" buffers are put onto a free-list in the context or
- * just freed (depending on the context's setting for freelist_max_len).
+ * TLS only.) Released buffers are freed.
*/
# define SSL_MODE_RELEASE_BUFFERS 0x00000010U
/*
@@ -2238,6 +2237,9 @@ int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
__owur const struct openssl_ssl_test_functions *SSL_test_functions(void);
# endif
+__owur int SSL_free_buffers(SSL *ssl);
+__owur int SSL_alloc_buffers(SSL *ssl);
+
extern const char SSL_version_str[];
int ERR_load_SSL_strings(void);