From: William A. Rowe Jr Date: Sat, 29 Dec 2007 07:55:43 +0000 (+0000) Subject: Fix winnt bucket_alloc to borrow memory from the transaction X-Git-Tag: 2.0.62~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffa2ab19cee0219462287dfa4cd5e638ef69c5b4;p=thirdparty%2Fapache%2Fhttpd.git Fix winnt bucket_alloc to borrow memory from the transaction pool, instead of exhausting pchild memory over a number of connections. PR: 11427 Submitted by: Alex Varju Backport: r607393 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@607395 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c index d575aadcdcc..1eccd9a5ec1 100644 --- a/server/mpm/winnt/child.c +++ b/server/mpm/winnt/child.c @@ -80,6 +80,7 @@ AP_DECLARE(void) mpm_recycle_completion_context(PCOMP_CONTEXT context) */ if (context) { apr_pool_clear(context->ptrans); + context->ba = apr_bucket_alloc_create(context->ptrans); context->next = NULL; ResetEvent(context->Overlapped.hEvent); apr_thread_mutex_lock(qlock); @@ -174,7 +175,7 @@ AP_DECLARE(PCOMP_CONTEXT) mpm_get_completion_context(void) 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); + context->ba = apr_bucket_alloc_create(context->ptrans); apr_atomic_inc(&num_completion_contexts); apr_thread_mutex_unlock(child_lock); @@ -424,7 +425,7 @@ static PCOMP_CONTEXT win9x_get_connection(PCOMP_CONTEXT context) apr_pool_create_ex(&context->ptrans, pchild, NULL, allocator); apr_allocator_owner_set(allocator, context->ptrans); apr_pool_tag(context->ptrans, "transaction"); - context->ba = apr_bucket_alloc_create(pchild); + context->ba = apr_bucket_alloc_create(context->ptrans); apr_thread_mutex_unlock(child_lock); }