Refactor the async wait fd logic
authorMatt Caswell <matt@openssl.org>
Mon, 25 Jan 2016 15:28:57 +0000 (15:28 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 29 Feb 2016 12:58:44 +0000 (12:58 +0000)
commitff75a25749c7fceaff7503af6f09d4299a052996
tree4f7d8161e709ea1b82e9ceef0d27f78393b18127
parentb32166b4fabd2a3aeec382521b0173b24a5d7c02
Refactor the async wait fd logic

Implementation experience has shown that the original plan for async wait
fds was too simplistic. Originally the async logic created a pipe internally
and user/engine code could then get access to it via API calls. It is more
flexible if the engine is able to create its own fd and provide it to the
async code.

Another issue is that there can be a lot of churn in the fd value within
the context of (say) a single SSL connection leading to continually adding
and removing fds from (say) epoll. It is better if we can provide some
stability of the fd value across a whole SSL connection. This is
problematic because an engine has no concept of an SSL connection.

This commit refactors things to introduce an ASYNC_WAIT_CTX which acts as a
proxy for an SSL connection down at the engine layer.

Reviewed-by: Richard Levitte <levitte@openssl.org>
21 files changed:
apps/apps.c
crypto/async/Makefile.in
crypto/async/arch/async_null.c
crypto/async/arch/async_posix.c
crypto/async/arch/async_win.c
crypto/async/async.c
crypto/async/async_locl.h
crypto/async/async_wait.c [new file with mode: 0644]
crypto/async/build.info
doc/crypto/ASYNC_WAIT_CTX_new.pod [new file with mode: 0644]
doc/crypto/ASYNC_start_job.pod
doc/ssl/SSL_get_all_async_fds.pod [new file with mode: 0644]
doc/ssl/SSL_get_async_wait_fd.pod [deleted file]
engines/e_dasync.c
include/openssl/async.h
include/openssl/ssl.h
ssl/ssl_lib.c
ssl/ssl_locl.h
test/asynctest.c
util/libeay.num
util/ssleay.num