httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/winnt mpm_winnt.c
Date Fri, 13 Jul 2001 18:46:16 GMT
stoddard    01/07/13 11:46:16

  Modified:    .        CHANGES
               server/mpm/winnt mpm_winnt.c
  Log:
  Win32: Prevent listening sockets from being inherited by
  the Apache child process, CGI scripts, rotatelog process
  etc.  If the Apache child process segfaults, any processes
  that the child started are not reaped. Prior to this fix,
  these processes inherited the listening sockets which sometimes
  prevented the restarted Apache child process from accepting
  connections (ie, the server would hang).
  
  The Sleep(1000) is a bit of a hack but it is sufficient I believe. All
  that is really necessary is for the parent to give up its quantum and
  allow the child to run. I could not get WaitForInputIdle to work properly.
  Will investigate alternative solutions later.
  
  Revision  Changes    Path
  1.247     +10 -1     httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.246
  retrieving revision 1.247
  diff -u -r1.246 -r1.247
  --- CHANGES	2001/07/12 02:19:41	1.246
  +++ CHANGES	2001/07/13 18:46:13	1.247
  @@ -1,5 +1,14 @@
   Changes with Apache 2.0.21-dev
  - 
  +
  +  *) Win32: Prevent listening sockets from being inherited by
  +     the Apache child process, CGI scripts, rotatelog process
  +     etc.  If the Apache child process segfaults, any processes 
  +     that the child started are not reaped. Prior to this fix,
  +     these processes inherited the listening sockets which sometimes
  +     prevented the restarted Apache child process from accepting
  +     connections (ie, the server would hang). 
  +     [Bill Stoddard]
  +
     *) Provide vhost and request strings when ExtendedStatus is on.
        [Greg Ames]
   
  
  
  
  1.162     +8 -1      httpd-2.0/server/mpm/winnt/mpm_winnt.c
  
  Index: mpm_winnt.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
  retrieving revision 1.161
  retrieving revision 1.162
  diff -u -r1.161 -r1.162
  --- mpm_winnt.c	2001/07/13 12:45:19	1.161
  +++ mpm_winnt.c	2001/07/13 18:46:15	1.162
  @@ -75,7 +75,6 @@
   #include "mpm_common.h"
   #include "scoreboard.h"
   
  -
   typedef HANDLE thread;
   #ifdef CONTAINING_RECORD
   #undef CONTAINING_RECORD
  @@ -1322,6 +1321,14 @@
       /* We never store the thread's handle, so close it now. */
       ResumeThread(pi.hThread);
       CloseHandle(pi.hThread);
  +
  +    /* Important:
  +     * Give the child process a chance to run before dup'ing the sockets.
  +     * We have already set the listening sockets noninheritable, but if 
  +     * WSADuplicateSocket runs before the child process initializes
  +     * the listeners will be inherited anyway.
  +     */
  +    Sleep(1000);
   
       /* Run the chain of open sockets. For each socket, duplicate it 
        * for the target process then send the WSAPROTOCOL_INFO 
  
  
  

Mime
View raw message