Commit efa323c3 authored by Greg Stein's avatar Greg Stein
Browse files

*) make find_liveprop() hook take a dav_resource rather than "r"

*) 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
parent 33102693
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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 */
	/*
+2 −1
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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),
+4 −3
Original line number Diff line number Diff line
@@ -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,
+2 −1
Original line number Diff line number Diff line
@@ -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;
Loading