From: Joe Orton Date: Mon, 2 Jun 2025 14:52:51 +0000 (+0000) Subject: Merge r1923639 from trunk: X-Git-Tag: 2.4.64-rc1-candidate~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c43d8e949b8dfd68cd050f193a5552f1c1ee8e93;p=thirdparty%2Fapache%2Fhttpd.git Merge r1923639 from trunk: 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. Github: closes #526 Reviewed by: jorton, rpluem, covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1926064 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/changes-entries/dav-get-base-path.txt b/changes-entries/dav-get-base-path.txt new file mode 100644 index 00000000000..e24e41dd897 --- /dev/null +++ b/changes-entries/dav-get-base-path.txt @@ -0,0 +1,2 @@ + *) mod_dav: Add API to expose DavBasePath setting. [Joe Orton] + diff --git a/include/ap_mmn.h b/include/ap_mmn.h index c124eb5370e..9bc1d6b1169 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -608,6 +608,7 @@ * 20120211.136 (2.4.63-dev) Add wait_io field to struct process_score * 20120211.137 (2.4.63-dev) Add AP_MPMQ_CAN_WAITIO * 20120211.138 (2.4.63-dev) Add is_host_matchable to proxy_worker_shared + * 20120211.139 (2.4.63-dev) Add dav_get_base_path() to mod_dav */ #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */ @@ -615,7 +616,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20120211 #endif -#define MODULE_MAGIC_NUMBER_MINOR 138 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 139 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 7a3eed7644a..2625f909cbf 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -250,6 +250,13 @@ DAV_DECLARE(const dav_hooks_search *) dav_get_search_hooks(request_rec *r) return dav_get_provider(r)->search; } +DAV_DECLARE(const char *) dav_get_base_path(request_rec *r) +{ + dav_dir_conf *conf = ap_get_module_config(r->per_dir_config, &dav_module); + + return conf && conf->base ? conf->base : NULL; +} + /* * Command handler for the DAV directive, which is TAKE1. */ diff --git a/modules/dav/main/mod_dav.h b/modules/dav/main/mod_dav.h index c8c54f38776..3c1309f6243 100644 --- a/modules/dav/main/mod_dav.h +++ b/modules/dav/main/mod_dav.h @@ -430,6 +430,11 @@ typedef struct dav_locktoken dav_locktoken; DAV_DECLARE(dav_error *) dav_get_resource(request_rec *r, int label_allowed, int use_checked_in, dav_resource **res_p); +/* +** If DavBasePath is configured for the request location, return the +** configured path, otherwise NULL. +*/ +DAV_DECLARE(const char *) dav_get_base_path(request_rec *r); /* -------------------------------------------------------------------- **