SSL_ALLOC_BUFFERS(3SSL)
π SSL_ALLOC_BUFFERS β the OpenSSL manual, 3SSL edition β¨
okay so bestie, you found the page for the buffer management girlies π
this is SSL_ALLOC_BUFFERS(3SSL) from OpenSSL, and we're gonna get you so comfy with it. no cap.
πΈ NAME πΈ
SSL_free_buffers, SSL_alloc_buffers β manage SSL structure buffers π«
π SYNOPSIS π
#include <openssl/ssl.h>
int SSL_free_buffers(SSL *ssl);
int SSL_alloc_buffers(SSL *ssl);
π¦ DESCRIPTION π¦
so like, two functions, two jobs, both iconic:
SSL_free_buffers() frees the read and write buffers of the given *ssl.
SSL_alloc_buffers() allocates the read and write buffers of the given *ssl.
now the lore π₯ β there's this mode called SSL_MODE_RELEASE_BUFFERS, right? and what it does is release read or write buffers whenever the buffers have been drained. like, it's on autopilot. these two functions here? they're the manual override. they let applications control by hand when buffers get freed and allocated. main character energy, honestly.
and here's the part that matters: after you free the buffers, they get automatically reallocated upon a new read or write. so you literally do not have to call SSL_alloc_buffers(). it's not mandatory, bestie. but you can call it to make sure the buffers are preallocated. why would you do that? two reasons, both slay:
- to avoid allocation during data processing π
- or with
CRYPTO_set_mem_functions()to control where and how buffers are allocated π
heads up: these functions are no-ops when used with QUIC SSL objects. for QUIC,SSL_free_buffers()always fails, andSSL_alloc_buffers()always succeeds. that's just how QUIC is. π
π« RETURN VALUES π«
the following return values can occur:
0 (Failure) π
SSL_free_buffers() returns 0 when there is pending data to be read or written. SSL_alloc_buffers() returns 0 when there is an allocation failure.
1 (Success) π
SSL_free_buffers() returns 1 if the buffers have been freed. this value is also returned if the buffers had been freed before calling SSL_free_buffers() (so like, it's chill either way π«Ά).
SSL_alloc_buffers() returns 1 if the buffers have been allocated. this value is also returned if the buffers had been allocated before calling SSL_alloc_buffers(). same energy, same vibe. π
π₯ SEE ALSO π₯
π COPYRIGHT π
Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
okay that's the whole page, you ate that π and for the cute sign-off: this was OpenSSL version 4.0.3, dated 2026-09-29, and you just read SSL_ALLOC_BUFFERS(3SSL). go free some buffers, you icon π
β¨π¦
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms