diff options
author | Matt Caswell <matt@openssl.org> | 2015-10-06 14:04:11 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-11-20 23:34:35 +0000 |
commit | e1b9840ed7c52346e4e203470210f7821158f708 (patch) | |
tree | 269940eca3c68159be0d8033e691631138ab31e2 /apps/apps.c | |
parent | 9920a58eb20dcf33abf231e8c9439953ace3c936 (diff) | |
download | openssl-e1b9840ed7c52346e4e203470210f7821158f708.tar.gz |
Add s_client support for waiting for async
s_server already had the ability to wait on an async file descriptor. This
adds it to s_client too.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/apps.c')
-rw-r--r-- | apps/apps.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/apps.c b/apps/apps.c index 89f43406bf..c6b70d63a8 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -2884,3 +2884,17 @@ BIO *bio_open_default_quiet(const char *filename, char mode, int format) return bio_open_default_(filename, mode, format, 1); } +void wait_for_async(SSL *s) +{ + int width, fd; + fd_set asyncfds; + + fd = SSL_get_async_wait_fd(s); + if (fd < 0) + return; + + width = fd + 1; + FD_ZERO(&asyncfds); + openssl_fdset(fd, &asyncfds); + select(width, (void *)&asyncfds, NULL, NULL, NULL); +} |