diff options
author | Joe Orton <jorton@apache.org> | 2019-04-18 12:25:33 +0200 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2019-04-18 12:25:33 +0200 |
commit | 835b74a4d080471c4cca9432e1482ee6c2b524dd (patch) | |
tree | 6972153c02be1cc5dbe65fb071c9d11361638649 /modules/dav | |
parent | Transforms. (diff) | |
download | apache2-835b74a4d080471c4cca9432e1482ee6c2b524dd.tar.xz apache2-835b74a4d080471c4cca9432e1482ee6c2b524dd.zip |
Fix use of StateDir directive after r1852982:
* server/core.c (reset_config): Rename from reset_config_defines;
tie core_state_dir to pconf lifetime in this cleanup.
(core_pre_config): Adjust accordingly.
* modules/md/mod_md_config.c (md_config_post_config): Pick up base_dir
from statedir in post-config phase so StateDir can influence it.
* modules/dav/fs/mod_dav_fs.c (dav_fs_create_server_config): Don't
init lockdb_path here. (dav_fs_post_config): New function; set
lockdb_path based on configured statedir.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1857731 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/dav')
-rw-r--r-- | modules/dav/fs/mod_dav_fs.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/modules/dav/fs/mod_dav_fs.c b/modules/dav/fs/mod_dav_fs.c index 50267cad66..985823d36f 100644 --- a/modules/dav/fs/mod_dav_fs.c +++ b/modules/dav/fs/mod_dav_fs.c @@ -46,11 +46,7 @@ const char *dav_get_lockdb_path(const request_rec *r) static void *dav_fs_create_server_config(apr_pool_t *p, server_rec *s) { - dav_fs_server_conf *conf = apr_pcalloc(p, sizeof(dav_fs_server_conf)); - - conf->lockdb_path = ap_state_dir_relative(p, DEFAULT_DAV_LOCKDB); - - return conf; + return apr_pcalloc(p, sizeof(dav_fs_server_conf)); } static void *dav_fs_merge_server_config(apr_pool_t *p, @@ -68,6 +64,24 @@ static void *dav_fs_merge_server_config(apr_pool_t *p, return newconf; } +static apr_status_t dav_fs_post_config(apr_pool_t *p, apr_pool_t *plog, + apr_pool_t *ptemp, server_rec *base_server) +{ + server_rec *s; + + for (s = base_server; s; s = s->next) { + dav_fs_server_conf *conf; + + conf = ap_get_module_config(s->module_config, &dav_fs_module); + + if (!conf->lockdb_path) { + conf->lockdb_path = ap_state_dir_relative(p, DEFAULT_DAV_LOCKDB); + } + } + + return OK; +} + /* * Command handler for the DAVLockDB directive, which is TAKE1 */ @@ -98,6 +112,8 @@ static const command_rec dav_fs_cmds[] = static void register_hooks(apr_pool_t *p) { + ap_hook_post_config(dav_fs_post_config, NULL, NULL, APR_HOOK_MIDDLE); + dav_hook_gather_propsets(dav_fs_gather_propsets, NULL, NULL, APR_HOOK_MIDDLE); dav_hook_find_liveprop(dav_fs_find_liveprop, NULL, NULL, APR_HOOK_MIDDLE); |