]> granicus.if.org Git - apache/commitdiff
Win32: Move apr_bucket_alloc() to a more reasonable location to fix memory leak.
authorBill Stoddard <stoddard@apache.org>
Mon, 1 Apr 2002 18:55:46 +0000 (18:55 +0000)
committerBill Stoddard <stoddard@apache.org>
Mon, 1 Apr 2002 18:55:46 +0000 (18:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94362 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/winnt/mpm_winnt.c
server/mpm/winnt/mpm_winnt.h

index 27996be64bb83f6f197e0ef3c6bea340d98f4ece..f7f3f6addb9b7a7a0d03b8b23eb6b5967a5a62a8 100644 (file)
@@ -266,6 +266,7 @@ AP_DECLARE(PCOMP_CONTEXT) mpm_get_completion_context(void)
             return NULL;
         }
         pCompContext->accept_socket = INVALID_SOCKET;
+        pCompContext->ba = apr_bucket_alloc_create(pchild);
         num_completion_contexts++;
     }
     return pCompContext;
@@ -839,8 +840,9 @@ static PCOMP_CONTEXT win9x_get_connection(PCOMP_CONTEXT context)
     if (context == NULL) {
         /* allocate the completion context and the transaction pool */
         context = apr_pcalloc(pconf, sizeof(COMP_CONTEXT));
-        apr_pool_create(&context->ptrans, pconf);
+        apr_pool_create(&context->ptrans, pchild);
         apr_pool_tag(context->ptrans, "ptrans");
+        context->ba = apr_bucket_alloc_create(pchild);
     }
     
 
@@ -1052,7 +1054,6 @@ static void worker_main(long thread_num)
 {
     static int requests_this_child = 0;
     PCOMP_CONTEXT context = NULL;
-    apr_bucket_alloc_t *bucket_alloc;
     apr_os_sock_info_t sockinfo;
     ap_sb_handle_t *sbh;
 
@@ -1076,9 +1077,6 @@ static void worker_main(long thread_num)
             break;
         }
 
-        /* XXX: where does this go? */
-        bucket_alloc = apr_bucket_alloc_create(context->ptrans);
-
         /* Have we hit MaxRequestPerChild connections? */
         if (ap_max_requests_per_child) {
             requests_this_child++;
@@ -1098,7 +1096,7 @@ static void worker_main(long thread_num)
         ap_create_sb_handle(&sbh, context->ptrans, 0, thread_num);
         c = ap_run_create_connection(context->ptrans, ap_server_conf,
                                      context->sock, thread_num, sbh,
-                                     bucket_alloc);
+                                     context->ba);
 
         if (c) {
             ap_process_connection(c, context->sock);
index 26397db7ad3bfd0e0f276762fef4f5446143b472..127512bbf0b41005f350cfd43f45816b3c4d061c 100644 (file)
@@ -199,6 +199,7 @@ typedef struct CompContext {
     struct sockaddr *sa_client;
     int sa_client_len;
     apr_pool_t *ptrans;
+    apr_bucket_alloc_t *ba;
 } COMP_CONTEXT, *PCOMP_CONTEXT;
 
 typedef enum {