]> granicus.if.org Git - apache/commitdiff
Create pmain pool and run modules' child_init hooks when entering
authorChris Darroch <chrisd@apache.org>
Tue, 2 Jan 2007 20:13:57 +0000 (20:13 +0000)
committerChris Darroch <chrisd@apache.org>
Tue, 2 Jan 2007 20:13:57 +0000 (20:13 +0000)
ap_mpm_run(), then destroy pmain when exiting ap_mpm_run().
The expected call to ap_run_child_init() appears to have been removed
in r89640.  However, that call should presumably still be made once per
process, as in other single-process MPMs like the netware MPM.

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

CHANGES
server/mpm/beos/beos.c

diff --git a/CHANGES b/CHANGES
index 654ad8e1b55a50174a1dd07d05a4de86472aedae..f4bd6bd636f41a834bc8e437b83b9409017cd931 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) beos MPM: Create pmain pool and run modules' child_init hooks when
+     entering ap_mpm_run(), then destroy pmain when exiting ap_mpm_run().
+     [Chris Darroch]
+
   *) netware MPM: Destroy pmain pool when exiting ap_mpm_run() so that
      cleanups registered in modules' child_init hooks are performed.
      [Chris Darroch]
index 30ed26d96c94cf6a771ef0c0ff91ac9e786a6f66..7c97d941d142c20d04ac4353f342d6f8e6caab62 100644 (file)
@@ -102,6 +102,7 @@ static int mpm_state = AP_MPMQ_STARTING;
 apr_thread_mutex_t *accept_mutex = NULL;
 
 static apr_pool_t *pconf;    /* Pool for config stuff */
+static apr_pool_t *pmain;    /* Pool for httpd child stuff */
 
 static int server_pid;
 
@@ -146,6 +147,14 @@ static void clean_child_exit(int code, int slot)
     exit_thread(code);
 }
 
+/* proper cleanup when returning from ap_mpm_run() */
+static void mpm_main_cleanup(void)
+{
+    if (pmain) {
+        apr_pool_destroy(pmain);
+    }
+}
+
 
 /*****************************************************************
  * Connection structures and accounting...
@@ -898,6 +907,9 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 
     set_signals();
 
+    apr_pool_create(&pmain, pconf);
+    ap_run_child_init(pmain, ap_server_conf);
+
     /* Sanity checks to avoid thrashing... */
     if (max_spare_threads < min_spare_threads )
         max_spare_threads = min_spare_threads;
@@ -972,6 +984,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
     }
 
     if (one_process) {
+        mpm_main_cleanup();
         return 1;
     }
 
@@ -995,6 +1008,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
                          "caught SIGTERM, shutting down");
         }
 
+        mpm_main_cleanup();
         return 1;
     }
 
@@ -1020,6 +1034,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
      */
     apr_thread_mutex_destroy(accept_mutex);
 
+    mpm_main_cleanup();
     return 0;
 }