diff options
author | Joe Orton <jorton@apache.org> | 2020-12-08 15:27:00 +0100 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2020-12-08 15:27:00 +0100 |
commit | bd08dcf1a8357eb3b1e862eaad13d9ac0c621cb2 (patch) | |
tree | 627e4a6acc9f546632dcab7c011de542a1469f3a /server/core.c | |
parent | Fix misleading crypt vs hash terminology in ht* and dbmmanage tools. (diff) | |
download | apache2-bd08dcf1a8357eb3b1e862eaad13d9ac0c621cb2.tar.xz apache2-bd08dcf1a8357eb3b1e862eaad13d9ac0c621cb2.zip |
Rearrange and clear global core config state allocated out of pconf
from a single cleanup:
* server/core.c (reset_config): Clear ap_runtime_dir here, rather than
in register_hooks.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884208 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/core.c')
-rw-r--r-- | server/core.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/core.c b/server/core.c index e2855540a5..9f81d421f1 100644 --- a/server/core.c +++ b/server/core.c @@ -127,15 +127,18 @@ AP_DECLARE_DATA int ap_document_root_check = 1; /* magic pointer for ErrorDocument xxx "default" */ static char errordocument_default; +/* Global state allocated out of pconf: variables here MUST be + * cleared/reset in reset_config(), a pconf cleanup, to avoid the + * variable getting reused after the pool is cleared. */ static apr_array_header_t *saved_server_config_defines = NULL; static apr_table_t *server_config_defined_vars = NULL; +AP_DECLARE_DATA const char *ap_runtime_dir = NULL; +static const char *core_state_dir; 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 = 0; -static const char *core_state_dir; - typedef struct { apr_ipsubnet_t *subnet; struct ap_logconf log; @@ -1489,6 +1492,7 @@ static apr_status_t reset_config(void *dummy) saved_server_config_defines = NULL; server_config_defined_vars = NULL; core_state_dir = NULL; + ap_runtime_dir = NULL; return APR_SUCCESS; } @@ -5863,7 +5867,6 @@ static int core_upgrade_storage(request_rec *r) static void register_hooks(apr_pool_t *p) { - ap_runtime_dir = NULL; errorlog_hash = apr_hash_make(p); ap_register_log_hooks(p); ap_register_config_hooks(p); |