Skip to content

Commit 0a1831c

Browse files
committed
Add API exposing the DavBasePath setting for use by DAV repository
backend modules (mod_dav_svn needs this for POST method handling). * modules/dav/main/mod_dav.c (dav_get_base_path): New function. * include/ap_mmn.h: Bump MMN minor.
1 parent 0ba38c2 commit 0a1831c

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*) mod_dav: Add API to expose DavBasePath setting. [Joe Orton]
2+

include/ap_mmn.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,14 +733,15 @@
733733
* 20211221.25 (2.5.1-dev) AP_SLASHES and AP_IS_SLASH
734734
* 20211221.26 (2.5.1-dev) Add is_host_matchable to proxy_worker_shared
735735
* 20211221.27 (2.5.1-dev) Add sock_proto to proxy_worker_shared, and AP_LISTEN_MPTCP
736+
* 20211221.28 (2.5.1-dev) Add dav_get_base_path() to mod_dav
736737
*/
737738

738739
#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
739740

740741
#ifndef MODULE_MAGIC_NUMBER_MAJOR
741742
#define MODULE_MAGIC_NUMBER_MAJOR 20211221
742743
#endif
743-
#define MODULE_MAGIC_NUMBER_MINOR 27 /* 0...n */
744+
#define MODULE_MAGIC_NUMBER_MINOR 28 /* 0...n */
744745

745746
/**
746747
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a

modules/dav/main/mod_dav.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ DAV_DECLARE(const dav_hooks_search *) dav_get_search_hooks(request_rec *r)
263263
return dav_get_provider(r)->search;
264264
}
265265

266+
DAV_DECLARE(const char *) dav_get_base_path(request_rec *r)
267+
{
268+
dav_dir_conf *conf = ap_get_module_config(r->per_dir_config, &dav_module);
269+
270+
return conf && conf->base ? conf->base : NULL;
271+
}
272+
266273
/*
267274
* Command handler for the DAV directive, which is TAKE1.
268275
*/

modules/dav/main/mod_dav.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,11 @@ typedef struct dav_locktoken dav_locktoken;
436436
DAV_DECLARE(dav_error *) dav_get_resource(request_rec *r, int label_allowed,
437437
int use_checked_in, dav_resource **res_p);
438438

439+
/*
440+
** If DavBasePath is configured for the request location, return the
441+
** configured path, otherwise NULL.
442+
*/
443+
DAV_DECLARE(const char *) dav_get_base_path(request_rec *r);
439444

440445
/* --------------------------------------------------------------------
441446
**

0 commit comments

Comments
 (0)