]> granicus.if.org Git - apache/commitdiff
Get MaxRequestsPerChild working on Windows.
authorBill Stoddard <stoddard@apache.org>
Tue, 3 Apr 2001 01:09:25 +0000 (01:09 +0000)
committerBill Stoddard <stoddard@apache.org>
Tue, 3 Apr 2001 01:09:25 +0000 (01:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88673 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
server/mpm/winnt/mpm_winnt.c

diff --git a/CHANGES b/CHANGES
index 224ce81bd7f48e72baa9f312627ce096eeef3b11..ab4518c4a5a2f00c7304512906ea0017f0ec8b6e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,6 @@
 Changes with Apache 2.0.16-dev
+  *) Get MaxRequestsPerChild working with the Windows MPM.
+     [Bill Stoddard]
 
   *) Make generic hooks to work, with mod_generic_hook_import/export
      experimental modules.  [Ben Laurie, Will Rowe]
diff --git a/STATUS b/STATUS
index 513cd7f27bd801302f24221b5dfe9623112c5505..3b5a227fb5a572f54fa8f6c1a0d5101a61602e68 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                             -*-text-*-
-Last modified at [$Date: 2001/04/03 00:27:08 $]
+Last modified at [$Date: 2001/04/03 01:09:16 $]
 
 Release:
 
@@ -28,9 +28,6 @@ RELEASE SHOWSTOPPERS:
         Status: patch brought forward from 1.3.14
                 WIN32 and OS2 need review [William Rowe, Brian Harvard]
 
-    * Win32: Enable the Windows MPM to honor max_requests_per_child
-        Status: FirstBill will fix this?
-
     * Win32: Get Apache working on Windows 95/98. The following work
        (at least) needs to be done:
        - winnt MPM: Fix 95/98 code paths in the winnt MPM. There is some NT
index 7598ef84d78d37813706d186d2258ecc2b9a0068..3e1776b19492bf910be6cbb104bafc7d9136960e 100644 (file)
@@ -671,6 +671,7 @@ static PCOMP_CONTEXT win9x_get_connection(PCOMP_CONTEXT context)
 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;
@@ -679,6 +680,9 @@ static void winnt_accept(void *listen_socket)
     nlsd = (SOCKET) listen_socket;
 
     while (!shutdown_in_progress) {
+        if (ap_max_requests_per_child && (requests_this_child > ap_max_requests_per_child)) {
+            break;
+       }
         pCompContext = NULL;
         /* Grab a context off the queue */
         apr_lock_acquire(qlock);
@@ -778,6 +782,12 @@ static void winnt_accept(void *listen_socket)
          */
         PostQueuedCompletionStatus(ThreadDispatchIOCP, 0, IOCP_CONNECTION_ACCEPTED,
                                    &pCompContext->Overlapped);
+        requests_this_child++;
+    }
+
+    if (!shutdown_in_progress) {
+        /* Yow, hit an irrecoverable error! Tell the child to die. */
+        SetEvent(exit_event);
     }
 }
 static PCOMP_CONTEXT winnt_get_connection(PCOMP_CONTEXT pCompContext)