From: Bill Stoddard Date: Tue, 3 Apr 2001 01:09:25 +0000 (+0000) Subject: Get MaxRequestsPerChild working on Windows. X-Git-Tag: 2.0.16~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1117eec74ed5c5f0fd9b12089086b3dfb3380311;p=apache Get MaxRequestsPerChild working on Windows. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88673 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 224ce81bd7..ab4518c4a5 100644 --- 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 513cd7f27b..3b5a227fb5 100644 --- 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 diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 7598ef84d7..3e1776b194 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -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)