httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r750569 - /httpd/httpd/trunk/server/mpm/winnt/child.c
Date Thu, 05 Mar 2009 20:00:05 GMT
Author: wrowe
Date: Thu Mar  5 20:00:03 2009
New Revision: 750569

URL: http://svn.apache.org/viewvc?rev=750569&view=rev
Log:
Until APR is actually fixed between apr_os_sock_make and the logic
within apr_socket_timeout_set, let's presume that vendor differences
of socket stack drivers can vary this behavior, and the assumptions
were unsafe for both accept() and AcceptEx().

Modified:
    httpd/httpd/trunk/server/mpm/winnt/child.c

Modified: httpd/httpd/trunk/server/mpm/winnt/child.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/child.c?rev=750569&r1=750568&r2=750569&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/child.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/child.c Thu Mar  5 20:00:03 2009
@@ -615,11 +615,6 @@
              * os_sock_make and os_sock_put that it does not query).
              */
             WSAEventSelect(context->accept_socket, 0, 0);
-            ioctlsocket(context->accept_socket, FIONBIO, &zero);
-            setsockopt(context->accept_socket, SOL_SOCKET, SO_RCVTIMEO, 
-                       (char *) &zero, sizeof(zero));
-            setsockopt(context->accept_socket, SOL_SOCKET, SO_SNDTIMEO, 
-                       (char *) &zero, sizeof(zero));
             context->overlapped.Pointer = NULL;
             err_count = 0;
         }
@@ -629,6 +624,16 @@
         sockinfo.remote  = context->sa_client;
         sockinfo.family  = context->sa_server->sa_family;
         sockinfo.type    = SOCK_STREAM;
+        /* Restore the state corresponding to apr_os_sock_make's default
+         * assumption of timeout -1 (really, a flaw of os_sock_make and 
+         * os_sock_put that it does not query to determine ->timeout).
+         * XXX: Upon a fix to APR, these three statements should disappear.
+         */
+        ioctlsocket(context->accept_socket, FIONBIO, &zero);
+        setsockopt(context->accept_socket, SOL_SOCKET, SO_RCVTIMEO, 
+                   (char *) &zero, sizeof(zero));
+        setsockopt(context->accept_socket, SOL_SOCKET, SO_SNDTIMEO, 
+                   (char *) &zero, sizeof(zero));
         apr_os_sock_make(&context->sock, &sockinfo, context->ptrans);
 
         /* When a connection is received, send an io completion notification



Mime
View raw message