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