apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r989443 - /apr/apr/trunk/file_io/win32/pipe.c
Date Thu, 26 Aug 2010 05:02:33 GMT
Author: mturk
Date: Thu Aug 26 05:02:33 2010
New Revision: 989443

URL: http://svn.apache.org/viewvc?rev=989443&view=rev
Log:
Loop if the recv gets WSAEWOULDBLOCK

Modified:
    apr/apr/trunk/file_io/win32/pipe.c

Modified: apr/apr/trunk/file_io/win32/pipe.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/win32/pipe.c?rev=989443&r1=989442&r2=989443&view=diff
==============================================================================
--- apr/apr/trunk/file_io/win32/pipe.c (original)
+++ apr/apr/trunk/file_io/win32/pipe.c Thu Aug 26 05:02:33 2010
@@ -321,7 +321,11 @@ static apr_status_t create_socket_pipe(S
         }
         /* Verify the connection by reading the send identification.
          */
-        nrd = recv(*rd, (char *)iid, sizeof(iid), 0);
+        do {
+            nrd = recv(*rd, (char *)iid, sizeof(iid), 0);
+            rv = nrd == SOCKET_ERROR ? apr_get_netos_error() : APR_SUCCESS;
+        } while (APR_STATUS_IS_EAGAIN(rv));
+
         if (nrd == sizeof(iid)) {
             if (memcmp(uid, iid, sizeof(uid)) == 0) {
                 /* Wow, we recived what we send.
@@ -337,7 +341,6 @@ static apr_status_t create_socket_pipe(S
             }
         }
         else if (nrd == SOCKET_ERROR) {
-            rv =  apr_get_netos_error();
             goto cleanup;
         }
         closesocket(*rd);



Mime
View raw message