]> granicus.if.org Git - apache/commitdiff
mod_dav: Provide a mechanism to obtain the request_rec and pathname
authorGraham Leggett <minfrin@apache.org>
Fri, 9 Oct 2009 21:41:31 +0000 (21:41 +0000)
committerGraham Leggett <minfrin@apache.org>
Fri, 9 Oct 2009 21:41:31 +0000 (21:41 +0000)
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

CHANGES
modules/dav/fs/repos.c
modules/dav/main/mod_dav.h

diff --git a/CHANGES b/CHANGES
index def7544af9c238b058307cfe50d745a99f298369..8f509176ebe4060596d3842023ddbe7bad23e783 100644 (file)
--- a/CHANGES
+++ b/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]
 
index 8364ab686d1b538c36c95ba682a977dcb140f58a..97006a68a043601e630580b5d37e9d39f1a8cd8e 100644 (file)
@@ -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,
index ac04cda419c14f9a4a1f01d618e7d9aeae59ddc3..7a402e52e76203dedcc24502eba6cebcfae74dcf 100644 (file)
@@ -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);
 };