]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
use state query API instead of static counters to determine processing
authorJeff Trawick <trawick@apache.org>
Mon, 20 Aug 2012 13:31:24 +0000 (13:31 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 20 Aug 2012 13:31:24 +0000 (13:31 +0000)
phase in check_config and post_config hooks

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

server/mpm/winnt/mpm_winnt.c

index cd2bb33f9999509dfe0695d9a82b07631e907653..94aaede59b06d12f5c998a7cb6444016cdbad663 100644 (file)
@@ -1402,12 +1402,12 @@ static int winnt_check_config(apr_pool_t *pconf, apr_pool_t *plog,
                               apr_pool_t *ptemp, server_rec* s)
 {
     int is_parent;
-    static int restart_num = 0;
     int startup = 0;
 
     /* We want this only in the parent and only the first time around */
     is_parent = (parent_pid == my_pid);
-    if (is_parent && restart_num++ == 0) {
+    if (is_parent &&
+        ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG) {
         startup = 1;
     }
 
@@ -1494,7 +1494,6 @@ static int winnt_check_config(apr_pool_t *pconf, apr_pool_t *plog,
 
 static int winnt_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec* s)
 {
-    static int restart_num = 0;
     apr_status_t rv = 0;
 
     /* Handle the following SCM aspects in this phase:
@@ -1554,7 +1553,8 @@ static int winnt_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pt
 
     if (parent_pid == my_pid)
     {
-        if (restart_num++ == 1)
+        if (ap_state_query(AP_SQ_MAIN_STATE) != AP_SQ_MS_CREATE_PRE_CONFIG
+            && ap_state_query(AP_SQ_CONFIG_GEN) == 1)
         {
             /* This code should be run once in the parent and not run
              * across a restart