xref: /openssl/doc/man3/SSL_alloc_buffers.pod (revision 0f84cbc3)
1=pod
2
3=head1 NAME
4
5SSL_free_buffers, SSL_alloc_buffers - manage SSL structure buffers
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_free_buffers(SSL *ssl);
12 int SSL_alloc_buffers(SSL *ssl);
13
14=head1 DESCRIPTION
15
16SSL_free_buffers() frees the read and write buffers of the given B<ssl>.
17SSL_alloc_buffers() allocates the read and write buffers of the given B<ssl>.
18
19The B<SSL_MODE_RELEASE_BUFFERS> mode releases read or write buffers whenever
20the buffers have been drained. These functions allow applications to manually
21control when buffers are freed and allocated.
22
23After freeing the buffers, the buffers are automatically reallocated upon a
24new read or write. The SSL_alloc_buffers() does not need to be called, but
25can be used to make sure the buffers are preallocated. This can be used to
26avoid allocation during data processing or with CRYPTO_set_mem_functions()
27to control where and how buffers are allocated.
28
29=head1 RETURN VALUES
30
31The following return values can occur:
32
33=over 4
34
35=item 0 (Failure)
36
37The SSL_free_buffers() function returns 0 when there is pending data to be
38read or written. The SSL_alloc_buffers() function returns 0 when there is
39an allocation failure.
40
41=item 1 (Success)
42
43The SSL_free_buffers() function returns 1 if the buffers have been freed. This
44value is also returned if the buffers had been freed before calling
45SSL_free_buffers().
46The SSL_alloc_buffers() function returns 1 if the buffers have been allocated.
47This value is also returned if the buffers had been allocated before calling
48SSL_alloc_buffers().
49
50=back
51
52=head1 SEE ALSO
53
54L<ssl(7)>,
55L<SSL_free(3)>, L<SSL_clear(3)>,
56L<SSL_new(3)>, L<SSL_CTX_set_mode(3)>,
57L<CRYPTO_set_mem_functions(3)>
58
59=head1 COPYRIGHT
60
61Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
62
63Licensed under the Apache License 2.0 (the "License").  You may not use
64this file except in compliance with the License.  You can obtain a copy
65in the file LICENSE in the source distribution or at
66L<https://www.openssl.org/source/license.html>.
67
68=cut
69