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 Sat, 20 Oct 2001 14:56:04 GMT
stoddard    01/10/20 07:56:04

  Modified:    server/mpm/winnt mpm_winnt.c
  Log:
  Win32: A bit more MaxRequestsPerChild cleanup. Now it should work on
  Win 9x as well.
  
  Revision  Changes    Path
  1.182     +15 -15    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.181
  retrieving revision 1.182
  diff -u -r1.181 -r1.182
  --- mpm_winnt.c	2001/10/19 21:11:03	1.181
  +++ mpm_winnt.c	2001/10/20 14:56:03	1.182
  @@ -507,7 +507,6 @@
   
   static void win9x_accept(void * dummy)
   {
  -    int requests_this_child = 0;
       struct timeval tv;
       fd_set main_fds;
       int wait_time = 1;
  @@ -537,10 +536,6 @@
       head_listener = ap_listeners;
   
       while (!shutdown_in_progress) {
  -        if (ap_max_requests_per_child && (requests_this_child > ap_max_requests_per_child))
{
  -            break;
  -	}
  -
   	tv.tv_sec = wait_time;
   	tv.tv_usec = 0;
   	memcpy(&main_fds, &listenfds, sizeof(fd_set));
  @@ -591,7 +586,6 @@
   	}
   	else {
   	    add_job(csd);
  -	    requests_this_child++;
   	}
       }
       SetEvent(exit_event);
  @@ -658,7 +652,6 @@
   static void winnt_accept(void *listen_socket) 
   {
       static int num_completion_contexts = 0;
  -    static int requests_this_child = 0;
       PCOMP_CONTEXT pCompContext;
       DWORD BytesRead;
       SOCKET nlsd;
  @@ -667,10 +660,7 @@
       nlsd = (SOCKET) listen_socket;
   
       while (!shutdown_in_progress) {
  -        if (ap_max_requests_per_child && (requests_this_child > ap_max_requests_per_child))
{
  -            SetEvent(max_requests_per_child_event);
  -            break;
  -	}
  +
           pCompContext = NULL;
           /* Grab a context off the queue */
           apr_lock_acquire(qlock);
  @@ -770,7 +760,7 @@
            */
           PostQueuedCompletionStatus(ThreadDispatchIOCP, 0, IOCP_CONNECTION_ACCEPTED,
                                      &pCompContext->Overlapped);
  -        requests_this_child++;
  +
       }
   
       if (!shutdown_in_progress) {
  @@ -780,7 +770,6 @@
   }
   static PCOMP_CONTEXT winnt_get_connection(PCOMP_CONTEXT pCompContext)
   {
  -    int requests_this_child = 0;
       int rc;
       DWORD BytesRead;
       DWORD CompKey;
  @@ -863,6 +852,7 @@
    */
   static void worker_main(int thread_num)
   {
  +    static int requests_this_child = 0;
       PCOMP_CONTEXT context = NULL;
       apr_os_sock_info_t sockinfo;
   
  @@ -873,6 +863,7 @@
           ap_update_child_status(0, thread_num, SERVER_READY, 
                                  (request_rec *) NULL);
   
  +
           /* Grab a connection off the network */
           if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
               context = win9x_get_connection(context);
  @@ -880,9 +871,18 @@
           else {
               context = winnt_get_connection(context);
           }
  -
  -        if (!context)
  +        if (!context) {
  +            /* Time for the thread to exit */
               break;
  +        }
  +
  +        /* Have we hit MaxRequestPerChild connections? */
  +        if (ap_max_requests_per_child) {
  +            requests_this_child++;
  +            if (requests_this_child > ap_max_requests_per_child) {
  +                SetEvent(max_requests_per_child_event);
  +            }
  +	}
   
           sockinfo.os_sock = &context->accept_socket;
           sockinfo.local   = context->sa_server;
  
  
  

Mime
View raw message