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