From: Greg Stein Date: Thu, 25 Jul 2002 21:56:05 +0000 (+0000) Subject: In some application environments, the mod_dav hook structures are X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ceceae704ba7604fbc8cf0ad5c023f08dfc4229;p=apache In some application environments, the mod_dav hook structures are allocated dynamically. The structures need a context pointer to represent that dynamic "object", so a pointer was added to the end of each of the more important structures. While providers don't need to add this field to their structures (it will default to NULL), I went ahead and added it to mod_dav_fs for clarity. No MMN bump is required because Apache does not use/examine the fields (only the provider will set and use them). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96195 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/dav/fs/dbm.c b/modules/dav/fs/dbm.c index d31ca26d16..ccc66644c8 100644 --- a/modules/dav/fs/dbm.c +++ b/modules/dav/fs/dbm.c @@ -789,4 +789,6 @@ const dav_hooks_db dav_hooks_db_dbm = dav_propdb_next_name, dav_propdb_get_rollback, dav_propdb_apply_rollback, + + NULL /* ctx */ }; diff --git a/modules/dav/fs/lock.c b/modules/dav/fs/lock.c index 1185af2a32..02a8518dd7 100644 --- a/modules/dav/fs/lock.c +++ b/modules/dav/fs/lock.c @@ -1549,5 +1549,7 @@ const dav_hooks_locks dav_hooks_locks_fs = dav_fs_append_locks, dav_fs_remove_lock, dav_fs_refresh_locks, - NULL, /* get_resource */ + NULL, /* lookup_resource */ + + NULL /* ctx */ }; diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c index cb34b3e17d..661e61201e 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -2098,7 +2098,9 @@ static const dav_provider dav_fs_provider = &dav_hooks_locks_fs, NULL, /* vsn */ NULL, /* binding */ - NULL /* search */ + NULL, /* search */ + + NULL /* ctx */ }; void dav_fs_gather_propsets(apr_array_header_t *uris) diff --git a/modules/dav/main/mod_dav.h b/modules/dav/main/mod_dav.h index 4793c3f6fd..47b7281cde 100644 --- a/modules/dav/main/mod_dav.h +++ b/modules/dav/main/mod_dav.h @@ -606,6 +606,10 @@ DAV_DECLARE(void) dav_xmlns_generate(dav_xmlns_info *xi, ** are handled through the APR_HOOK interface (to allow for multiple liveprop ** providers). The core always provides some properties, and then a given ** provider will add more properties. +** +** Some providers may need to associate a context with the dav_provider +** structure -- the ctx field is available for storing this context. Just +** leave it NULL if it isn't required. */ typedef struct { const dav_hooks_repository *repos; @@ -614,6 +618,8 @@ typedef struct { const dav_hooks_vsn *vsn; const dav_hooks_binding *binding; const dav_hooks_search *search; + + void *ctx; } dav_provider; /* @@ -858,6 +864,12 @@ struct dav_hooks_liveprop int operation, void *context, dav_liveprop_rollback *rollback_ctx); + + /* + ** If a provider needs a context to associate with this hooks structure, + ** then this field may be used. In most cases, it will just be NULL. + */ + void *ctx; }; /* @@ -1135,6 +1147,12 @@ struct dav_hooks_propdb dav_deadprop_rollback **prollback); dav_error * (*apply_rollback)(dav_db *db, dav_deadprop_rollback *rollback); + + /* + ** If a provider needs a context to associate with this hooks structure, + ** then this field may be used. In most cases, it will just be NULL. + */ + void *ctx; }; @@ -1481,6 +1499,12 @@ struct dav_hooks_locks const dav_locktoken *locktoken, const dav_resource *start_resource, const dav_resource **resource); + + /* + ** If a provider needs a context to associate with this hooks structure, + ** then this field may be used. In most cases, it will just be NULL. + */ + void *ctx; }; /* what types of resources can be discovered by dav_get_resource_state() */ @@ -1921,6 +1945,12 @@ struct dav_hooks_repository /* Get the entity tag for a resource */ const char * (*getetag)(const dav_resource *resource); + + /* + ** If a provider needs a context to associate with this hooks structure, + ** then this field may be used. In most cases, it will just be NULL. + */ + void *ctx; }; @@ -2310,6 +2340,12 @@ struct dav_hooks_vsn int no_auto_merge, int no_checkout, apr_xml_elem *prop_elem, ap_filter_t *output); + + /* + ** If a provider needs a context to associate with this hooks structure, + ** then this field may be used. In most cases, it will just be NULL. + */ + void *ctx; }; @@ -2334,6 +2370,12 @@ struct dav_hooks_binding { dav_error * (*bind_resource)(const dav_resource *resource, dav_resource *binding); + /* + ** If a provider needs a context to associate with this hooks structure, + ** then this field may be used. In most cases, it will just be NULL. + */ + void *ctx; + }; @@ -2366,6 +2408,12 @@ struct dav_hooks_search { dav_error * (*search_resource)(request_rec *r, dav_response **response); + /* + ** If a provider needs a context to associate with this hooks structure, + ** then this field may be used. In most cases, it will just be NULL. + */ + void *ctx; + };