From: Jeff Trawick Date: Mon, 20 Aug 2012 13:31:24 +0000 (+0000) Subject: use state query API instead of static counters to determine processing X-Git-Tag: 2.5.0-alpha~6398 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f51c575d252e846874943c9c1d995370e1390ab8;p=thirdparty%2Fapache%2Fhttpd.git use state query API instead of static counters to determine processing 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 --- diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index cd2bb33f999..94aaede59b0 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -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