mod_dav_fs.c revision 975e51c02f55eaa15e6c5c65ffd89f6c0431e4f5
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek/* Licensed to the Apache Software Foundation (ASF) under one or more
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * contributor license agreements. See the NOTICE file distributed with
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * this work for additional information regarding copyright ownership.
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * The ASF licenses this file to You under the Apache License, Version 2.0
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * (the "License"); you may not use this file except in compliance with
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * the License. You may obtain a copy of the License at
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * http://www.apache.org/licenses/LICENSE-2.0
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * Unless required by applicable law or agreed to in writing, software
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * distributed under the License is distributed on an "AS IS" BASIS,
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * See the License for the specific language governing permissions and
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek * limitations under the License.
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek/* per-server configuration */
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersenextern module AP_MODULE_DECLARE_DATA dav_fs_module;
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmekconst char *dav_get_lockdb_path(const request_rec *r)
20bde8192332cff5a2fcf7059a4b48b9fca75e63Evgeny Vereshchagin conf = ap_get_module_config(r->server->module_config, &dav_fs_module);
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmekstatic void *dav_fs_create_server_config(apr_pool_t *p, server_rec *s)
20bde8192332cff5a2fcf7059a4b48b9fca75e63Evgeny Vereshchagin dav_fs_server_conf *conf = apr_pcalloc(p, sizeof(dav_fs_server_conf));
20bde8192332cff5a2fcf7059a4b48b9fca75e63Evgeny Vereshchagin conf->lockdb_path = DEFAULT_EXP_DAVLOCKDB;
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmekstatic void *dav_fs_merge_server_config(apr_pool_t *p,
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek dav_fs_server_conf *parent = base;
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek dav_fs_server_conf *child = overrides;
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek newconf = apr_pcalloc(p, sizeof(*newconf));
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek child->lockdb_path ? child->lockdb_path : parent->lockdb_path;
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersen * Command handler for the DAVLockDB directive, which is TAKE1
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersenstatic const char *dav_fs_cmd_davlockdb(cmd_parms *cmd, void *config,
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersen conf = ap_get_module_config(cmd->server->module_config,
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersen conf->lockdb_path = ap_server_root_relative(cmd->pool, arg1);
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersen return apr_pstrcat(cmd->pool, "Invalid DAVLockDB path ",
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersen AP_INIT_TAKE1("DAVLockDB", dav_fs_cmd_davlockdb, NULL, RSRC_CONF,
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersen "specify a lock database"),
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersenstatic void register_hooks(apr_pool_t *p)
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersen dav_hook_gather_propsets(dav_fs_gather_propsets, NULL, NULL,
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersen dav_hook_find_liveprop(dav_fs_find_liveprop, NULL, NULL, APR_HOOK_MIDDLE);
761a7c71b649b5e926c28c703a11fbdc22dd6df1Thomas Hindoe Paaboel Andersen dav_hook_insert_all_liveprops(dav_fs_insert_all_liveprops, NULL, NULL,
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek NULL, /* dir merger --- default is to override */
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek dav_fs_create_server_config, /* server config */
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek dav_fs_merge_server_config, /* merge server config */
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek dav_fs_cmds, /* command table */
64eed40c07efb4e2b316ebb4e7481b7a891b7934Zbigniew Jędrzejewski-Szmek register_hooks, /* register hooks */