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