httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Windows testers, AcceptFilter troubles solved?
Date Sat, 17 Mar 2012 01:32:12 GMT
Ok folks, here's what we know; on some platforms the blocking behavior
is not being honored and SSL is terminated due to the "client's failure"
to provide enough bytes in time.  In fact it is the fault of apr plus
the socket stack for not returning without more bytes.

That said, I neglected the fact that the following functions replace
the passed variable with the old value, "un-zeroing" the value of zero!

Please give this patch a whirl and let us know what you all see on various
windows boxes with AcceptFilter data|connect|none against the ssl listener;


Index: server/mpm/winnt/child.c
===================================================================
--- server/mpm/winnt/child.c	(revision 1301675)
+++ server/mpm/winnt/child.c	(working copy)
@@ -291,7 +291,7 @@
     SOCKADDR_STORAGE ss_listen;
     int namelen = sizeof(ss_listen);
 #endif
-    u_long zero = 0;
+    u_long zero;

     core_sconf = ap_get_core_module_config(ap_server_conf->module_config);
     accf_name = apr_table_get(core_sconf->accf_map, lr->protocol);
@@ -655,16 +655,21 @@
         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.
          */
+        zero = 0;
         ioctlsocket(context->accept_socket, FIONBIO, &zero);
+        zero = 0;
         setsockopt(context->accept_socket, SOL_SOCKET, SO_RCVTIMEO,
                    (char *) &zero, sizeof(zero));
+        zero = 0;
         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