You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by iv...@apache.org on 2022/01/20 12:18:41 UTC

svn commit: r1897245 - /apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation/file_io/win32/pipe.c

Author: ivan
Date: Thu Jan 20 12:18:40 2022
New Revision: 1897245

URL: http://svn.apache.org/viewvc?rev=1897245&view=rev
Log:
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.

Modified:
    apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation/file_io/win32/pipe.c

Modified: apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation/file_io/win32/pipe.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation/file_io/win32/pipe.c?rev=1897245&r1=1897244&r2=1897245&view=diff
==============================================================================
--- apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation/file_io/win32/pipe.c (original)
+++ apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation/file_io/win32/pipe.c Thu Jan 20 12:18:40 2022
@@ -381,14 +381,7 @@ static apr_status_t create_socket_pipe(S
             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_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,