SSL_get_all_async_fds.pod 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 comment 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 SSL_MODE_ASYNC mode in
  18. 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 SSL object
  24. is currently waiting for asynchronous work to complete (i.e.
  25. SSL_ERROR_WANT_ASYNC has been received - see L<SSL_get_error(3)>). Typically the
  26. 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 B<*numfds> and the file descriptors themselves
  29. are in B<*fds>. The B<fds> parameter may be NULL in which case no file
  30. descriptors are returned but B<*numfds> is still populated. It is the callers
  31. responsibility to ensure sufficient memory is allocated at B<*fds> so typically
  32. this function is called twice (once with a NULL B<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. SSL_ERROR_WANT_ASYNC was received (or since the SSL object was created if no
  37. SSL_ERROR_WANT_ASYNC has been received). Similar to SSL_get_all_async_fds() it
  38. is the callers responsibility to ensure that B<*addfd> and B<*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 B<*numaddfds> and B<*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 openssl/async.h header is dependent on some
  49. of the types customarily made available by including 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. windows.h prior to async.h.
  54. =head1 SEE ALSO
  55. L<SSL_get_error(3)>, L<SSL_CTX_set_mode(3)>
  56. =head1 HISTORY
  57. SSL_waiting_for_async(), SSL_get_all_async_fds() and SSL_get_changed_async_fds()
  58. were first added to OpenSSL 1.1.0.
  59. =head1 COPYRIGHT
  60. Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
  61. Licensed under the OpenSSL license (the "License"). You may not use
  62. this file except in compliance with the License. You can obtain a copy
  63. in the file LICENSE in the source distribution or at
  64. L<https://www.openssl.org/source/license.html>.
  65. =cut