httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1564313 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS server/mpm/winnt/child.c
Date Tue, 04 Feb 2014 14:22:19 GMT
Author: jim
Date: Tue Feb  4 14:22:18 2014
New Revision: 1564313

URL: http://svn.apache.org/r1564313
Log:
Merge r1523387 from trunk:

In 2.4, the MPM leaves a copy of the non-disconnected FD sitting in
context->accept_socket. This FD will be closed a second time, often
shortly after a worker picks it up in this same FD being reused.  The
first recv fails with WSAENOTSOCK since the same FD was closed in the
listener thread while the worker was pulling it off the queue

(The second close is of the underlying FD/socket, not a shared
apr_socket_t, so it's not short-circuited)

This patch makes it a bit more 2.2.x-ish and solves my problem -- the
context->accept_socket gets zapped at the bottom of the loop if
!disconnected.


Submitted by: covener
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1523387

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1564313&r1=1564312&r2=1564313&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Tue Feb  4 14:22:18 2014
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.4.8
 
+  *) WinNT MPM: If ap_run_pre_connection() fails or sets c->aborted, don't
+     save the socket for reuse by the next worker as if it were an 
+     APR_SO_DISCONNECTED socket. Restores 2.2 behavior. [Eric Covener]
+
   *) mod_dir: Don't search for a DirectoryIndex or DirectorySlash on a URL
      that was just rewritten by mod_rewrite. PR53929. [Eric Covener]
 

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1564313&r1=1564312&r2=1564313&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Tue Feb  4 14:22:18 2014
@@ -98,12 +98,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * WinNT MPM: If ap_run_pre_connection() fails or sets c->aborted, don't
-     save the socket for reuse by the next worker as if it were an
-     APR_SO_DISCONNECTED socket. Restores 2.2 behavior.
-     trunk patch: http://svn.apache.org/r1523387
-     2.4.x patch: trunk works
-     +1: trawick, covener, jim
 
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:

Modified: httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c?rev=1564313&r1=1564312&r2=1564313&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c (original)
+++ httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c Tue Feb  4 14:22:18 2014
@@ -878,12 +878,13 @@ static DWORD __stdcall worker_main(void 
 
         if (!c->aborted) {
             ap_run_process_connection(c);
+        }
 
-            apr_socket_opt_get(context->sock, APR_SO_DISCONNECTED,
-                               &disconnected);
+        apr_socket_opt_get(context->sock, APR_SO_DISCONNECTED, &disconnected);
 
-            if (!disconnected) {
-                context->accept_socket = INVALID_SOCKET;
+        if (!disconnected) {
+            context->accept_socket = INVALID_SOCKET;
+            if (!c->aborted) { 
                 ap_lingering_close(c);
             }
         }



Mime
View raw message