]> granicus.if.org Git - apache/commitdiff
*) make find_liveprop() hook take a dav_resource rather than "r"
authorGreg Stein <gstein@apache.org>
Mon, 27 Nov 2000 12:54:28 +0000 (12:54 +0000)
committerGreg Stein <gstein@apache.org>
Mon, 27 Nov 2000 12:54:28 +0000 (12:54 +0000)
*) repos.c: liveprop hooks shouldn't respond if the resource is not an FS
     resource.
*) std_liveprop.c: use empty-elem form if value=="". return NOTDEF for the
     properties that we aren't ready to insert yet

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87087 13f79535-47bb-0310-9956-ffa450edef68

modules/dav/fs/repos.c
modules/dav/fs/repos.h
modules/dav/main/mod_dav.c
modules/dav/main/mod_dav.h
modules/dav/main/props.c
modules/dav/main/std_liveprop.c

index 06878921f19bc55ec63d19db1ed30c7e7cd4cebf..6030ca5b44e2089345bfa3e5328bce0428f3a020 100644 (file)
@@ -1998,15 +1998,23 @@ void dav_fs_gather_propsets(apr_array_header_t *uris)
 #endif
 }
 
-int dav_fs_find_liveprop(request_rec *r, const char *ns_uri, const char *name,
+int dav_fs_find_liveprop(const dav_resource *resource,
+                         const char *ns_uri, const char *name,
                          const dav_hooks_liveprop **hooks)
 {
+    /* don't try to find any liveprops if this isn't "our" resource */
+    if (resource->hooks != &dav_hooks_repository_fs)
+        return 0;
     return dav_do_find_liveprop(ns_uri, name, &dav_fs_liveprop_group, hooks);
 }
 
 void dav_fs_insert_all_liveprops(request_rec *r, const dav_resource *resource,
                                  int insvalue, ap_text_header *phdr)
 {
+    /* don't insert any liveprops if this isn't "our" resource */
+    if (resource->hooks != &dav_hooks_repository_fs)
+        return;
+
     if (!resource->exists) {
        /* a lock-null resource */
        /*
index 43ab9422fe370503f0e7949ddfb08d01baffeeb5..cfdd9dbc5358eb79633a94c495da19064b205b04 100644 (file)
@@ -99,7 +99,8 @@ const dav_hooks_locks *dav_fs_get_lock_hooks(request_rec *r);
 const dav_hooks_propdb *dav_fs_get_propdb_hooks(request_rec *r);
 
 void dav_fs_gather_propsets(apr_array_header_t *uris);
-int dav_fs_find_liveprop(request_rec *r, const char *ns_uri, const char *name,
+int dav_fs_find_liveprop(const dav_resource *resource,
+                         const char *ns_uri, const char *name,
                          const dav_hooks_liveprop **hooks);
 void dav_fs_insert_all_liveprops(request_rec *r, const dav_resource *resource,
                                  int insvalue, ap_text_header *phdr);
index cfc8bcc9797b143e817526a830aa2ff1847cd0dd..360b66f4f914b8461b73e91f6f8f277f5648bb45 100644 (file)
@@ -4071,10 +4071,10 @@ AP_IMPLEMENT_EXTERNAL_HOOK_VOID(DAV, gather_propsets,
                                 (apr_array_header_t *uris),
                                 (uris))
 AP_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(DAV, int, find_liveprop,
-                                     (request_rec *r, const char *ns_uri,
-                                      const char *name,
+                                     (const dav_resource *resource,
+                                      const char *ns_uri, const char *name,
                                       const dav_hooks_liveprop **hooks),
-                                     (r, ns_uri, name, hooks), 0);
+                                     (resource, ns_uri, name, hooks), 0);
 AP_IMPLEMENT_EXTERNAL_HOOK_VOID(DAV, insert_all_liveprops,
                                 (request_rec *r, const dav_resource *resource,
                                  int insvalue, ap_text_header *phdr),
index df9cda48fab7a9510a7de4f85988b234431e3b83..592778db3f98986fa75e1617088f8fa3aabdbc31 100644 (file)
@@ -561,7 +561,8 @@ AP_DECLARE_EXTERNAL_HOOK(DAV, void, gather_propsets,
 ** Return 0 if the property is not defined by the hook implementor.
 */
 AP_DECLARE_EXTERNAL_HOOK(DAV, int, find_liveprop,
-                         (request_rec *r, const char *ns_uri, const char *name,
+                         (const dav_resource *resource,
+                          const char *ns_uri, const char *name,
                           const dav_hooks_liveprop **hooks))
 
 /*
@@ -834,8 +835,8 @@ void dav_add_all_liveprop_xmlns(apr_pool_t *p, ap_text_header *phdr);
 ** The following three functions are part of mod_dav's internal handling
 ** for the core WebDAV properties. They are not part of mod_dav's API.
 */
-int dav_core_find_liveprop(request_rec *r, const char *ns_uri,
-                           const char *name,
+int dav_core_find_liveprop(const dav_resource *resource,
+                           const char *ns_uri, const char *name,
                            const dav_hooks_liveprop **hooks);
 void dav_core_insert_all_liveprops(request_rec *r,
                                    const dav_resource *resource,
index 21c020adae060861b00b9a6ff51abbb996515cc6..1b0627b10f87a04d420aeb267056aa2ccf7a11cf 100644 (file)
@@ -354,7 +354,8 @@ static void dav_find_liveprop(dav_propdb *propdb, ap_xml_elem *elem)
     ns_uri = AP_XML_GET_URI_ITEM(propdb->ns_xlate, elem->ns);
 
     /* is there a liveprop provider for this property? */
-    propid = ap_run_find_liveprop(propdb->r, ns_uri, elem->name, &hooks);
+    propid = ap_run_find_liveprop(propdb->resource, ns_uri, elem->name,
+                                  &hooks);
     if (propid != 0) {
         priv->propid = propid;
         priv->provider = hooks;
index 0f7d26e0a63b332b228fde1df759d54598db095b..8ae1782ebde97cc100a5df5f200d0fc8668393ee 100644 (file)
@@ -147,10 +147,12 @@ static dav_prop_insert dav_core_insert_prop(const dav_resource *resource,
 
     case DAV_PROPID_supported_live_property_set:
         /* ### insert all live property names ### */
+        return DAV_PROP_INSERT_NOTDEF;
         break;
 
     case DAV_PROPID_supported_method_set:
         /* ### leverage code from dav_method_options ### */
+        return DAV_PROP_INSERT_NOTDEF;
         break;
 
     case DAV_PROPID_supported_report_set:
@@ -216,7 +218,7 @@ static dav_prop_insert dav_core_insert_prop(const dav_resource *resource,
 
     /* assert: info != NULL && info->name != NULL */
 
-    if (insvalue) {
+    if (insvalue && *value != '\0') {
         s = apr_psprintf(p, "<lp%d:%s>%s</lp%d:%s>" DEBUG_CR,
                          global_ns, info->name, value, global_ns, info->name);
         which = DAV_PROP_INSERT_VALUE;
@@ -260,8 +262,8 @@ static const dav_hooks_liveprop dav_core_hooks_liveprop = {
     NULL,       /* patch_rollback */
 };
 
-int dav_core_find_liveprop(request_rec *r, const char *ns_uri,
-                           const char *name,
+int dav_core_find_liveprop(const dav_resource *resource,
+                           const char *ns_uri, const char *name,
                            const dav_hooks_liveprop **hooks)
 {
     return dav_do_find_liveprop(ns_uri, name, &dav_core_liveprop_group, hooks);