mirror of
https://github.com/apache/httpd.git
synced 2025-08-13 14:40:20 +00:00
mod_dav: Provide a mechanism to obtain the request_rec and pathname
from the dav_resource. Submitted by: Jari Urpalainen <jari.urpalainen nokia.com>, Brian France <brian brianfrance.com> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@823703 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
4
CHANGES
4
CHANGES
@ -10,6 +10,10 @@ Changes with Apache 2.3.3
|
||||
mod_proxy_ftp: NULL pointer dereference on error paths.
|
||||
[Stefan Fritsch <sf fritsch.de>, Joe Orton]
|
||||
|
||||
*) mod_dav: Provide a mechanism to obtain the request_rec and pathname
|
||||
from the dav_resource. [Jari Urpalainen <jari.urpalainen nokia.com>,
|
||||
Brian France <brian brianfrance.com>]
|
||||
|
||||
*) Build: Use install instead of cp if available on installing
|
||||
modules to avoid segmentation fault. PR 47951. [hirose31 gmail.com]
|
||||
|
||||
|
@ -46,6 +46,7 @@ struct dav_resource_private {
|
||||
apr_pool_t *pool; /* memory storage pool associated with request */
|
||||
const char *pathname; /* full pathname to resource */
|
||||
apr_finfo_t finfo; /* filesystem info */
|
||||
request_rec *r;
|
||||
};
|
||||
|
||||
/* private context for doing a filesystem walk */
|
||||
@ -210,6 +211,11 @@ static dav_error * dav_fs_internal_walk(const dav_walk_params *params,
|
||||
**
|
||||
** PRIVATE REPOSITORY FUNCTIONS
|
||||
*/
|
||||
request_rec *dav_fs_get_request_rec(const dav_resource *resource)
|
||||
{
|
||||
return resource->info->r;
|
||||
}
|
||||
|
||||
apr_pool_t *dav_fs_pool(const dav_resource *resource)
|
||||
{
|
||||
return resource->info->pool;
|
||||
@ -648,6 +654,7 @@ static dav_error * dav_fs_get_resource(
|
||||
/* Create private resource context descriptor */
|
||||
ctx = apr_pcalloc(r->pool, sizeof(*ctx));
|
||||
ctx->finfo = r->finfo;
|
||||
ctx->r = r;
|
||||
|
||||
/* ### this should go away */
|
||||
ctx->pool = r->pool;
|
||||
@ -1816,6 +1823,9 @@ static const dav_hooks_repository dav_hooks_repository_fs =
|
||||
dav_fs_remove_resource,
|
||||
dav_fs_walk,
|
||||
dav_fs_getetag,
|
||||
dav_fs_get_request_rec,
|
||||
dav_fs_pathname,
|
||||
NULL
|
||||
};
|
||||
|
||||
static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource,
|
||||
|
@ -1940,6 +1940,12 @@ struct dav_hooks_repository
|
||||
** then this field may be used. In most cases, it will just be NULL.
|
||||
*/
|
||||
void *ctx;
|
||||
|
||||
/* return request record */
|
||||
request_rec * (*get_request_rec)(const dav_resource *resource);
|
||||
|
||||
/* return path */
|
||||
const char * (*get_pathname)(const dav_resource *resource);
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user