You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2012/08/20 15:31:25 UTC

svn commit: r1375013 - /httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c

Author: trawick
Date: Mon Aug 20 13:31:24 2012
New Revision: 1375013

URL: http://svn.apache.org/viewvc?rev=1375013&view=rev
Log:
use state query API instead of static counters to determine processing
phase in check_config and post_config hooks

Modified:
    httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c

Modified: httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c?rev=1375013&r1=1375012&r2=1375013&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c Mon Aug 20 13:31:24 2012
@@ -1402,12 +1402,12 @@ static int winnt_check_config(apr_pool_t
                               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
 
 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 
 
     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