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