SSL_alloc_buffers.pod 2.1 KB

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