From: Greg Stein Date: Sat, 20 Jan 2001 11:29:35 +0000 (+0000) Subject: some stylistic tweaks post- John's patch X-Git-Tag: APACHE_2_0_BETA_CANDIDATE_1~149 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9d7c604f2146ab479a6aa6eb1533c33dfe083ac;p=apache some stylistic tweaks post- John's patch git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87758 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c index 913067d591..f9ac747ff3 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -1814,8 +1814,9 @@ static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource, } else { /* assert: what == DAV_PROP_INSERT_SUPPORTED */ - s = apr_psprintf(p, "" DEBUG_CR, + s = apr_psprintf(p, + "" DEBUG_CR, info->name, dav_fs_namespace_uris[info->ns]); } ap_text_append(p, phdr, s); @@ -1903,7 +1904,7 @@ static dav_error *dav_fs_patch_validate(const dav_resource *resource, } -static dav_error *dav_fs_patch_exec(dav_resource *resource, +static dav_error *dav_fs_patch_exec(const dav_resource *resource, const ap_xml_elem *elem, int operation, void *context, @@ -1938,7 +1939,7 @@ static dav_error *dav_fs_patch_exec(dav_resource *resource, return NULL; } -static void dav_fs_patch_commit(dav_resource *resource, +static void dav_fs_patch_commit(const dav_resource *resource, int operation, void *context, dav_liveprop_rollback *rollback_ctx) @@ -1946,7 +1947,7 @@ static void dav_fs_patch_commit(dav_resource *resource, /* nothing to do */ } -static dav_error *dav_fs_patch_rollback(dav_resource *resource, +static dav_error *dav_fs_patch_rollback(const dav_resource *resource, int operation, void *context, dav_liveprop_rollback *rollback_ctx) diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 3fe03d223b..fd52528987 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -1342,14 +1342,14 @@ static dav_error *dav_gen_supported_live_props(request_rec *r, if ((err = dav_open_lockdb(r, 0, &lockdb)) != NULL) { return dav_push_error(r->pool, err->status, 0, "The lock database could not be opened, " - "preventing report of supported lock properties.", + "preventing the reporting of supported lock " + "properties.", err); } /* open the property database (readonly) for the resource */ - if ((err = dav_open_propdb(r, lockdb, - (dav_resource *)resource, 1, - NULL, &propdb)) != NULL) { + if ((err = dav_open_propdb(r, lockdb, resource, 1, NULL, + &propdb)) != NULL) { if (lockdb != NULL) (*lockdb->hooks->close_lockdb)(lockdb); @@ -1388,8 +1388,9 @@ static dav_error *dav_gen_supported_live_props(request_rec *r, if (name == NULL) { err = dav_new_error(r->pool, HTTP_BAD_REQUEST, 0, - "A DAV:supported-live-property element " - "does not have a \"name\" attribute"); + "A DAV:supported-live-property " + "element does not have a \"name\" " + "attribute"); break; } @@ -1433,10 +1434,10 @@ static dav_error *dav_gen_supported_reports(request_rec *r, if ((err = (*vsn_hooks->avail_reports)(resource, &reports)) != NULL) { return dav_push_error(r->pool, err->status, 0, - "DAV:supported-report-set could not be determined " - "due to a problem fetching the available reports " - "for this resource.", - err); + "DAV:supported-report-set could not be " + "determined due to a problem fetching the " + "available reports for this resource.", + err); } if (reports != NULL) { @@ -1664,6 +1665,8 @@ static int dav_method_options(request_rec *r) } else if (resource->working) { apr_table_addn(methods, "CHECKIN", ""); + + /* ### we might not support this DeltaV option */ apr_table_addn(methods, "UNCHECKOUT", ""); } else if (vsn_hooks->add_label != NULL) { @@ -1819,8 +1822,7 @@ static dav_error * dav_propfind_walker(dav_walk_resource *wres, int calltype) ** Note: we cast to lose the "const". The propdb won't try to change ** the resource, however, since we are opening readonly. */ - err = dav_open_propdb(ctx->r, ctx->w.lockdb, - (dav_resource *)wres->resource, 1, + err = dav_open_propdb(ctx->r, ctx->w.lockdb, wres->resource, 1, ctx->doc ? ctx->doc->namespaces : NULL, &propdb); if (err != NULL) { /* ### do something with err! */ diff --git a/modules/dav/main/mod_dav.h b/modules/dav/main/mod_dav.h index a58bb8acce..6d553692d8 100644 --- a/modules/dav/main/mod_dav.h +++ b/modules/dav/main/mod_dav.h @@ -497,8 +497,8 @@ typedef enum { resource (it may be present as a dead property). */ DAV_PROP_INSERT_NOTSUPP, /* property is recognized by this provider, - * but it is not supported, and cannot be - * treated as a dead property */ + but it is not supported, and cannot be + treated as a dead property */ DAV_PROP_INSERT_NAME, /* a property name (empty elem) was inserted into the text block */ DAV_PROP_INSERT_VALUE, /* a property name/value pair was inserted @@ -707,10 +707,10 @@ struct dav_hooks_liveprop ** a DAV:supported-live-property element, as defined ** by the DeltaV extensions to RFC2518. ** - ** Providers should return DAV_PROP_INSERT_NOTDEF if they do not define - ** the specified propid, but allow the property to be handled as a - ** dead property. If a provider recognizes, but does not support, - ** a property, and does not want it handled as a dead property, it should + ** Providers should return DAV_PROP_INSERT_NOTDEF if the property is + ** known and not defined for this resource, so should be handled as a + ** dead property. If a provider recognizes, but does not support, a + ** property, and does not want it handled as a dead property, it should ** return DAV_PROP_INSERT_NOTSUPP. ** ** Returns one of DAV_PROP_INSERT_* based on what happened. @@ -778,20 +778,20 @@ struct dav_hooks_liveprop int *defer_to_dead); /* ### doc... */ - dav_error * (*patch_exec)(dav_resource *resource, + dav_error * (*patch_exec)(const dav_resource *resource, const ap_xml_elem *elem, int operation, void *context, dav_liveprop_rollback **rollback_ctx); /* ### doc... */ - void (*patch_commit)(dav_resource *resource, + void (*patch_commit)(const dav_resource *resource, int operation, void *context, dav_liveprop_rollback *rollback_ctx); /* ### doc... */ - dav_error * (*patch_rollback)(dav_resource *resource, + dav_error * (*patch_rollback)(const dav_resource *resource, int operation, void *context, dav_liveprop_rollback *rollback_ctx); @@ -1355,7 +1355,7 @@ typedef struct dav_propdb dav_propdb; dav_error *dav_open_propdb( request_rec *r, dav_lockdb *lockdb, - dav_resource *resource, + const dav_resource *resource, int ro, apr_array_header_t *ns_xlate, dav_propdb **propdb); diff --git a/modules/dav/main/props.c b/modules/dav/main/props.c index e529deac3b..58b369c000 100644 --- a/modules/dav/main/props.c +++ b/modules/dav/main/props.c @@ -250,7 +250,7 @@ struct dav_propdb { apr_pool_t *p; /* the pool we should use */ request_rec *r; /* the request record */ - dav_resource *resource; /* the target resource */ + const dav_resource *resource; /* the target resource */ int deferred; /* open of db has been deferred */ dav_db *db; /* underlying database containing props */ @@ -375,6 +375,8 @@ static void dav_find_liveprop(dav_propdb *propdb, ap_xml_elem *elem) priv->propid = dav_find_liveprop_provider(propdb, ns_uri, elem->name, &hooks); + + /* ### this test seems redundant... */ if (priv->propid != DAV_PROPID_CORE_UNKNOWN) { priv->provider = hooks; } @@ -921,7 +923,7 @@ static dav_error *dav_really_open_db(dav_propdb *propdb, int ro) } dav_error *dav_open_propdb(request_rec *r, dav_lockdb *lockdb, - dav_resource *resource, + const dav_resource *resource, int ro, apr_array_header_t * ns_xlate, dav_propdb **p_propdb) @@ -1228,7 +1230,8 @@ dav_get_props_result dav_get_props(dav_propdb *propdb, ap_xml_doc *doc) } /* - ** If not handled as a live property, look in the dead property database + ** If not handled as a live property, look in the dead property + ** database. */ if (!is_liveprop) { /* make sure propdb is really open */ diff --git a/modules/dav/main/std_liveprop.c b/modules/dav/main/std_liveprop.c index 01b6b925af..d730ee0ca4 100644 --- a/modules/dav/main/std_liveprop.c +++ b/modules/dav/main/std_liveprop.c @@ -160,11 +160,12 @@ static dav_prop_insert dav_core_insert_prop(const dav_resource *resource, /* assert: info != NULL && info->name != NULL */ if (what == DAV_PROP_INSERT_SUPPORTED) { - s = apr_psprintf(p, "" DEBUG_CR, + s = apr_psprintf(p, + "" DEBUG_CR, info->name, dav_core_namespace_uris[info->ns]); } - else if (what == DAV_PROP_INSERT_VALUE && *value != '\0') { + else if (what == DAV_PROP_INSERT_VALUE && *value != '\0') { s = apr_psprintf(p, "%s" DEBUG_CR, global_ns, info->name, value, global_ns, info->name); }