On Fri, 2007-10-05 at 16:56 +1000, Bojan Smojver wrote:

> Keep you posted...

Another approach attached.

-- 
Bojan
--- server/mpm/prefork/prefork.c	2007-10-05 17:27:13.000000000 +1000
+++ server/mpm/prefork/prefork.c.patched	2007-10-05 17:14:25.000000000 +1000
@@ -465,7 +465,7 @@
 
 static void child_main(int child_num_arg)
 {
-    apr_pool_t *ptrans;
+    apr_pool_t *ptrans = NULL;
     apr_allocator_t *allocator;
     apr_status_t status;
     int i;
@@ -493,9 +493,6 @@
     apr_pool_create_ex(&pchild, pconf, NULL, allocator);
     apr_allocator_owner_set(allocator, pchild);
 
-    apr_pool_create(&ptrans, pchild);
-    apr_pool_tag(ptrans, "transaction");
-
     /* needs to be done before we switch UIDs so we have permissions */
     ap_reopen_scoreboard(pchild, NULL, 0);
     status = apr_proc_mutex_child_init(&accept_mutex, ap_lock_fname, pchild);
@@ -534,8 +531,6 @@
 
     mpm_state = AP_MPMQ_RUNNING;
 
-    bucket_alloc = apr_bucket_alloc_create(pchild);
-
     while (!die_now) {
         conn_rec *current_conn;
         void *csd;
@@ -544,7 +539,17 @@
          * (Re)initialize this child to a pre-connection state.
          */
 
-        apr_pool_clear(ptrans);
+        if (ptrans) {
+            apr_bucket_alloc_destroy(bucket_alloc);
+            apr_pool_destroy(ptrans);
+        }
+
+        apr_allocator_create(&allocator);
+        apr_pool_create_ex(&ptrans, pchild, NULL, allocator);
+        apr_allocator_owner_set(allocator, ptrans);
+        apr_pool_tag(ptrans, "transaction");
+
+        bucket_alloc = apr_bucket_alloc_create(ptrans);
 
         if ((ap_max_requests_per_child > 0
              && requests_this_child++ >= ap_max_requests_per_child)) {

Reply via email to