Apache HTTPD
mod_dav_fs.c
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "httpd.h"
18#include "http_config.h"
19#include "apr_strings.h"
20
21#include "mod_dav.h"
22#include "repos.h"
23
24/* per-server configuration */
25typedef struct {
26 const char *lockdb_path;
27
29
30extern module AP_MODULE_DECLARE_DATA dav_fs_module;
31
33{
35
36 conf = ap_get_module_config(r->server->module_config, &dav_fs_module);
37 return conf->lockdb_path;
38}
39
44
46 void *base, void *overrides)
47{
51
52 newconf = apr_pcalloc(p, sizeof(*newconf));
53
54 newconf->lockdb_path =
55 child->lockdb_path ? child->lockdb_path : parent->lockdb_path;
56
57 return newconf;
58}
59
60/*
61 * Command handler for the DAVLockDB directive, which is TAKE1
62 */
63static const char *dav_fs_cmd_davlockdb(cmd_parms *cmd, void *config,
64 const char *arg1)
65{
67 conf = ap_get_module_config(cmd->server->module_config,
68 &dav_fs_module);
70
71 if (!conf->lockdb_path) {
72 return apr_pstrcat(cmd->pool, "Invalid DAVLockDB path ",
73 arg1, NULL);
74 }
75
76 return NULL;
77}
78
79static const command_rec dav_fs_cmds[] =
80{
81 /* per server */
83 "specify a lock database"),
84
85 { NULL }
86};
87
98
100{
102 NULL, /* dir config creater */
103 NULL, /* dir merger --- default is to override */
104 dav_fs_create_server_config, /* server config */
105 dav_fs_merge_server_config, /* merge server config */
106 dav_fs_cmds, /* command table */
107 register_hooks, /* register hooks */
108};
APR Strings library.
#define AP_INIT_TAKE1(directive, func, mconfig, where, help)
#define ap_get_module_config(v, m)
#define AP_DECLARE_MODULE(foo)
ap_conf_vector_t * base
char * ap_server_root_relative(apr_pool_t *p, const char *fname)
Definition config.c:1594
request_rec * r
#define APR_HOOK_MIDDLE
Definition apr_hooks.h:303
#define RSRC_CONF
void dav_hook_find_liveprop(dav_HOOK_find_liveprop_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
Definition mod_dav.c:5247
void dav_fs_register(apr_pool_t *p)
Definition repos.c:2276
const char * dav_get_lockdb_path(const request_rec *r)
Definition mod_dav_fs.c:32
void dav_hook_gather_propsets(dav_HOOK_gather_propsets_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
Definition mod_dav.c:5241
int dav_fs_find_liveprop(const dav_resource *resource, const char *ns_uri, const char *name, const dav_hooks_liveprop **hooks)
Definition repos.c:2231
void dav_hook_insert_all_liveprops(dav_HOOK_insert_all_liveprops_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
Definition mod_dav.c:5252
void dav_fs_insert_all_liveprops(request_rec *r, const dav_resource *resource, dav_prop_insert what, apr_text_header *phdr)
Definition repos.c:2241
void dav_fs_gather_propsets(apr_array_header_t *uris)
Definition repos.c:2223
#define STANDARD20_MODULE_STUFF
apr_size_t size
apr_pool_t * parent
Definition apr_pools.h:197
#define apr_pcalloc(p, size)
Definition apr_pools.h:465
const char * s
Definition apr_strings.h:95
apr_cmdtype_e cmd
Apache Configuration.
HTTP Daemon routines.
apr_pool_t * p
Definition md_event.c:32
DAV extension module for Apache 2.0.*.
static const command_rec dav_fs_cmds[]
Definition mod_dav_fs.c:79
static const char * dav_fs_cmd_davlockdb(cmd_parms *cmd, void *config, const char *arg1)
Definition mod_dav_fs.c:63
static void * dav_fs_create_server_config(apr_pool_t *p, server_rec *s)
Definition mod_dav_fs.c:40
static void register_hooks(apr_pool_t *p)
Definition mod_dav_fs.c:88
static void * dav_fs_merge_server_config(apr_pool_t *p, void *base, void *overrides)
Definition mod_dav_fs.c:45
return NULL
Definition mod_so.c:359
Declarations for the filesystem repository implementation.
const char * lockdb_path
Definition mod_dav_fs.c:26
A structure that represents the current request.
Definition httpd.h:845
server_rec * server
Definition httpd.h:851
A structure to store information for each virtual server.
Definition httpd.h:1322
struct ap_conf_vector_t * module_config
Definition httpd.h:1341