SSL_get_all_async_fds.pod 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. =pod
  2. =head1 NAME
  3. SSL_waiting_for_async,
  4. SSL_get_all_async_fds,
  5. SSL_get_changed_async_fds
  6. - manage asynchronous operations
  7. =head1 SYNOPSIS
  8. =for openssl multiple includes
  9. #include <openssl/async.h>
  10. #include <openssl/ssl.h>
  11. int SSL_waiting_for_async(SSL *s);
  12. int SSL_get_all_async_fds(SSL *s, OSSL_ASYNC_FD *fd, size_t *numfds);
  13. int SSL_get_changed_async_fds(SSL *s, OSSL_ASYNC_FD *addfd, size_t *numaddfds,
  14. OSSL_ASYNC_FD *delfd, size_t *numdelfds);
  15. =head1 DESCRIPTION
  16. SSL_waiting_for_async() determines whether an SSL connection is currently
  17. waiting for asynchronous operations to complete (see the B<SSL_MODE_ASYNC> mode
  18. in L<SSL_CTX_set_mode(3)>).
  19. SSL_get_all_async_fds() returns a list of file descriptor which can be used in a
  20. call to select() or poll() to determine whether the current asynchronous
  21. operation has completed or not. A completed operation will result in data
  22. appearing as "read ready" on the file descriptor (no actual data should be read
  23. from the file descriptor). This function should only be called if the B<SSL>
  24. object is currently waiting for asynchronous work to complete (i.e.
  25. B<SSL_ERROR_WANT_ASYNC> has been received - see L<SSL_get_error(3)>). Typically
  26. the list will only contain one file descriptor. However, if multiple asynchronous
  27. capable engines are in use then more than one is possible. The number of file
  28. descriptors returned is stored in I<*numfds> and the file descriptors themselves
  29. are in I<*fds>. The I<fds> parameter may be NULL in which case no file
  30. descriptors are returned but I<*numfds> is still populated. It is the callers
  31. responsibility to ensure sufficient memory is allocated at I<*fds> so typically
  32. this function is called twice (once with a NULL I<fds> parameter and once
  33. without).
  34. SSL_get_changed_async_fds() returns a list of the asynchronous file descriptors
  35. that have been added and a list that have been deleted since the last
  36. B<SSL_ERROR_WANT_ASYNC> was received (or since the B<SSL> object was created if
  37. no B<SSL_ERROR_WANT_ASYNC> has been received). Similar to SSL_get_all_async_fds()
  38. it is the callers responsibility to ensure that I<*addfd> and I<*delfd> have
  39. sufficient memory allocated, although they may be NULL. The number of added fds
  40. and the number of deleted fds are stored in I<*numaddfds> and I<*numdelfds>
  41. respectively.
  42. =head1 RETURN VALUES
  43. SSL_waiting_for_async() will return 1 if the current SSL operation is waiting
  44. for an async operation to complete and 0 otherwise.
  45. SSL_get_all_async_fds() and SSL_get_changed_async_fds() return 1 on success or
  46. 0 on error.
  47. =head1 NOTES
  48. On Windows platforms the F<< <openssl/async.h> >> header is dependent on some
  49. of the types customarily made available by including F<< <windows.h> >>. The
  50. application developer is likely to require control over when the latter
  51. is included, commonly as one of the first included headers. Therefore,
  52. it is defined as an application developer's responsibility to include
  53. F<< <windows.h> >> prior to F<< <openssl/async.h> >>.
  54. =head1 SEE ALSO
  55. L<ssl(7)>,
  56. L<SSL_get_error(3)>, L<SSL_CTX_set_mode(3)>
  57. =head1 HISTORY
  58. The SSL_waiting_for_async(), SSL_get_all_async_fds()
  59. and SSL_get_changed_async_fds() functions were added in OpenSSL 1.1.0.
  60. =head1 COPYRIGHT
  61. Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
  62. Licensed under the Apache License 2.0 (the "License"). You may not use
  63. this file except in compliance with the License. You can obtain a copy
  64. in the file LICENSE in the source distribution or at
  65. L<https://www.openssl.org/source/license.html>.
  66. =cut