]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Win32: Make Win32 MPM transaction pools honor MaxMemFree
authorBill Stoddard <stoddard@apache.org>
Thu, 20 Nov 2003 19:44:18 +0000 (19:44 +0000)
committerBill Stoddard <stoddard@apache.org>
Thu, 20 Nov 2003 19:44:18 +0000 (19:44 +0000)
PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101817 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/mpm/winnt/child.c
server/mpm/winnt/mpm.h

diff --git a/CHANGES b/CHANGES
index e45250edf73bc38c7e5de0ec5ba867437167de3d..8352a5e3dbb223cf5c7b539b2956f5a5131b8340 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
 Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
+  *) Win32 MPM: The bucket brigades subsystem now honors the MaxMemFree setting.
+     [Bill Stoddard]
 
   *) mod_autoindex: new directive IndexStyleSheet 
     [Tyler Riddle <triddle_1999 yahoo.com>, Paul Querna <chip force-elite.com>]
index f1034f6c94dcc2805f49be20a6a42a8696f43f14..d09633a69725dd5b3ff783497be76c3e216f7d53 100644 (file)
@@ -185,6 +185,8 @@ AP_DECLARE(PCOMP_CONTEXT) mpm_get_completion_context(void)
                  * Multiple failures in the next two steps will cause the pchild pool
                  * to 'leak' storage. I don't think this is worth fixing...
                  */
+                apr_allocator_t *allocator;
+
                 context = (PCOMP_CONTEXT) apr_pcalloc(pchild, sizeof(COMP_CONTEXT));
   
                 context->Overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
@@ -196,13 +198,17 @@ AP_DECLARE(PCOMP_CONTEXT) mpm_get_completion_context(void)
                 }
  
                 /* Create the tranaction pool */
-                if ((rv = apr_pool_create(&context->ptrans, pchild)) != APR_SUCCESS) {
+                apr_allocator_create(&allocator);
+                apr_allocator_max_free_set(allocator, ap_max_mem_free);
+                rv = apr_pool_create_ex(&context->ptrans, NULL, NULL, allocator);
+                if (rv != APR_SUCCESS) {
                     ap_log_error(APLOG_MARK,APLOG_WARNING, rv, ap_server_conf,
                                  "mpm_get_completion_context: Failed to create the transaction pool.");
                     CloseHandle(context->Overlapped.hEvent);
                     return NULL;
                 }
-                apr_pool_tag(context->ptrans, "ptrans");
+                apr_allocator_owner_set(allocator, context->ptrans);
+                apr_pool_tag(context->ptrans, "transaction");
  
                 context->accept_socket = INVALID_SOCKET;
                 context->ba = apr_bucket_alloc_create(pchild);
@@ -437,9 +443,13 @@ static PCOMP_CONTEXT win9x_get_connection(PCOMP_CONTEXT context)
 
     if (context == NULL) {
         /* allocate the completion context and the transaction pool */
+        apr_allocator_t *allocator;
         context = apr_pcalloc(pchild, sizeof(COMP_CONTEXT));
-        apr_pool_create(&context->ptrans, pchild);
-        apr_pool_tag(context->ptrans, "ptrans");
+        apr_allocator_create(&allocator);
+        apr_allocator_max_free_set(allocator, ap_max_mem_free);
+        apr_pool_create_ex(&context->ptrans, NULL, NULL, allocator);
+        apr_allocator_owner_set(allocator, context->ptrans);
+        apr_pool_tag(context->ptrans, "transaction");
         context->ba = apr_bucket_alloc_create(pchild);
     }
     
index 0c0825a0cb688d7bcb40de8e8c6d45d268aa4ed8..08bcf91f7c3d296923ae2822596e9b3507e83773 100644 (file)
@@ -72,6 +72,7 @@
 #define AP_MPM_WANT_SET_MAX_REQUESTS
 #define AP_MPM_WANT_SET_COREDUMPDIR
 #define AP_MPM_WANT_SET_SCOREBOARD
+#define AP_MPM_WANT_SET_MAX_MEM_FREE
 
 extern int ap_threads_per_child;
 extern int ap_thread_limit;