Add in a configuration generation... this is independent of

MPM gen, just in case we ever switch MPMs at a graceful ;)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087331 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jim Jagielski
2011-03-31 15:12:09 +00:00
parent e13e716026
commit 6bd438fe64
5 changed files with 11 additions and 1 deletions

View File

@ -808,6 +808,8 @@ AP_DECLARE(int) ap_state_query(int query_code);
#define AP_SQ_MAIN_STATE 0
/** are we going to serve requests or are we just testing/dumping config */
#define AP_SQ_RUN_MODE 1
/** generation of the top-level apache parent */
#define AP_SQ_CONFIG_GEN 2
/*
* return values for ap_state_query()

View File

@ -51,6 +51,8 @@ AP_DECLARE_DATA extern apr_pool_t *ap_pglobal;
AP_DECLARE_DATA extern int ap_main_state;
/** run mode (normal, config test, config dump, ...) */
AP_DECLARE_DATA extern int ap_run_mode;
/** run mode (normal, config test, config dump, ...) */
AP_DECLARE_DATA extern int ap_config_generation;
/* for -C, -c and -D switches */
/** An array of all -C directives. These are processed before the server's

View File

@ -390,7 +390,9 @@ static int status_handler(request_rec *r)
ap_scoreboard_image->global->restart_time,
DEFAULT_TIME_FORMAT, 0),
"</dt>\n", NULL);
ap_rprintf(r, "<dt>Parent Server Generation: %d</dt>\n",
ap_rprintf(r, "<dt>Parent Server Config. Generation: %d</dt>\n",
ap_state_query(AP_SQ_CONFIG_GEN));
ap_rprintf(r, "<dt>Parent Server MPM Generation: %d</dt>\n",
(int)mpm_generation);
ap_rputs("<dt>Server uptime: ", r);
show_time(r, up_time);

View File

@ -112,6 +112,7 @@ static apr_table_t *server_config_defined_vars = NULL;
AP_DECLARE_DATA int ap_main_state = AP_SQ_MS_INITIAL_STARTUP;
AP_DECLARE_DATA int ap_run_mode = AP_SQ_RM_UNKNOWN;
AP_DECLARE_DATA int ap_config_generation = 1;
static void *create_core_dir_config(apr_pool_t *a, char *dir)
{
@ -4368,6 +4369,8 @@ AP_DECLARE(int) ap_state_query(int query)
return ap_main_state;
case AP_SQ_RUN_MODE:
return ap_run_mode;
case AP_SQ_CONFIG_GEN:
return ap_config_generation;
default:
return AP_SQ_NOT_SUPPORTED;
}

View File

@ -686,6 +686,7 @@ int main(int argc, const char * const argv[])
apr_pool_destroy(ptemp);
for (;;) {
ap_config_generation++;
ap_main_state = AP_SQ_MS_DESTROY_CONFIG;
apr_hook_deregister_all();
apr_pool_clear(pconf);