diff options
author | Matt Caswell <matt@openssl.org> | 2016-01-25 15:28:57 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-02-29 12:58:44 +0000 |
commit | ff75a25749c7fceaff7503af6f09d4299a052996 (patch) | |
tree | 4f7d8161e709ea1b82e9ceef0d27f78393b18127 /crypto/async/arch/async_win.c | |
parent | b32166b4fabd2a3aeec382521b0173b24a5d7c02 (diff) |
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>
Diffstat (limited to 'crypto/async/arch/async_win.c')
-rw-r--r-- | crypto/async/arch/async_win.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/crypto/async/arch/async_win.c b/crypto/async/arch/async_win.c index e862e2548f..c0776b1239 100644 --- a/crypto/async/arch/async_win.c +++ b/crypto/async/arch/async_win.c @@ -127,42 +127,6 @@ VOID CALLBACK async_start_func_win(PVOID unused) async_start_func(); } -int async_pipe(OSSL_ASYNC_FD *pipefds) -{ - if (CreatePipe(&pipefds[0], &pipefds[1], NULL, 256) == 0) - return 0; - - return 1; -} - -int async_close_fd(OSSL_ASYNC_FD fd) -{ - if (CloseHandle(fd) == 0) - return 0; - - return 1; -} - -int async_write1(OSSL_ASYNC_FD fd, const void *buf) -{ - DWORD numwritten = 0; - - if (WriteFile(fd, buf, 1, &numwritten, NULL) && numwritten == 1) - return 1; - - return 0; -} - -int async_read1(OSSL_ASYNC_FD fd, void *buf) -{ - DWORD numread = 0; - - if (ReadFile(fd, buf, 1, &numread, NULL) && numread == 1) - return 1; - - return 0; -} - async_pool *async_get_pool(void) { return (async_pool *)TlsGetValue(asyncwinpool); |