Skip to content

Commit

Permalink
Add API exposing the DavBasePath setting for use by DAV repository
Browse files Browse the repository at this point in the history
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 #513


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1923639 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
notroj committed Feb 7, 2025
1 parent e07b7a2 commit 1db5c23
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changes-entries/dav-get-base-path.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*) mod_dav: Add API to expose DavBasePath setting. [Joe Orton]

3 changes: 2 additions & 1 deletion include/ap_mmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -733,14 +733,15 @@
* 20211221.25 (2.5.1-dev) AP_SLASHES and AP_IS_SLASH
* 20211221.26 (2.5.1-dev) Add is_host_matchable to proxy_worker_shared
* 20211221.27 (2.5.1-dev) Add sock_proto to proxy_worker_shared, and AP_LISTEN_MPTCP
* 20211221.28 (2.5.1-dev) Add dav_get_base_path() to mod_dav
*/

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

#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20211221
#endif
#define MODULE_MAGIC_NUMBER_MINOR 27 /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 28 /* 0...n */

/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
Expand Down
7 changes: 7 additions & 0 deletions modules/dav/main/mod_dav.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,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.
*/
Expand Down
5 changes: 5 additions & 0 deletions modules/dav/main/mod_dav.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,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);

/* --------------------------------------------------------------------
**
Expand Down

0 comments on commit 1db5c23

Please sign in to comment.