diff options
author | ivan <ivan@13f79535-47bb-0310-9956-ffa450edef68> | 2022-01-20 12:18:40 +0000 |
---|---|---|
committer | ivan <ivan@13f79535-47bb-0310-9956-ffa450edef68> | 2022-01-20 12:18:40 +0000 |
commit | f3df99a080f75f9c0a637623f356ea601c217a52 (patch) | |
tree | add54cd551fca0f22903d64e5c350602ed49164d | |
parent | c8e6366ade86a87c5e37b2f032a77c1fc11c9b54 (diff) | |
download | libapr-f3df99a080f75f9c0a637623f356ea601c217a52.tar.gz |
On 'win32-pollset-wakeup-no-file-socket-emulation' branch:
Set socket nonblocking mode for socket using apr_socket_timeout_set().
Patch by: ylavic
* file_io/win32/pipe.c
(create_socket_pipe): Remove code to set SOCKET to nonblocking mode.
(apr_file_socket_pipe_create): Set IN socket to nonblocking mode.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation@1897245 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | file_io/win32/pipe.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index fc2933519..a28fdb843 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -381,14 +381,7 @@ static apr_status_t create_socket_pipe(SOCKET *rd, SOCKET *wr) goto cleanup; } if (nrd == (int)sizeof(uid) && memcmp(iid, uid, sizeof(uid)) == 0) { - /* Got the right identifier, put the poll()able read side of - * the pipe in nonblocking mode and return. - */ - bm = 1; - if (ioctlsocket(*rd, FIONBIO, &bm) == SOCKET_ERROR) { - rv = apr_get_netos_error(); - goto cleanup; - } + /* Got the right identifier, return. */ break; } closesocket(*rd); @@ -438,6 +431,9 @@ apr_status_t apr_file_socket_pipe_create(apr_socket_t **in, apr_os_sock_put(in, &rd, p); apr_os_sock_put(out, &wr, p); + /* read end of the pipe is non-blocking */ + apr_socket_timeout_set(*in, 0); + apr_pool_cleanup_register(p, (void *)(*in), socket_pipe_cleanup, apr_pool_cleanup_null); apr_pool_cleanup_register(p, (void *)(*out), socket_pipe_cleanup, |