diff options
Diffstat (limited to 'subversion/mod_dav_svn/reports/get-locations.c')
-rw-r--r-- | subversion/mod_dav_svn/reports/get-locations.c | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/subversion/mod_dav_svn/reports/get-locations.c b/subversion/mod_dav_svn/reports/get-locations.c index 164045f..da70300 100644 --- a/subversion/mod_dav_svn/reports/get-locations.c +++ b/subversion/mod_dav_svn/reports/get-locations.c @@ -44,23 +44,20 @@ #include "../dav_svn.h" -static apr_status_t -send_get_locations_report(ap_filter_t *output, +static svn_error_t * +send_get_locations_report(dav_svn__output *output, apr_bucket_brigade *bb, const dav_resource *resource, apr_hash_t *fs_locations) { apr_hash_index_t *hi; - apr_pool_t *pool; - apr_status_t apr_err; + apr_pool_t *pool = resource->pool; - pool = resource->pool; - - apr_err = ap_fprintf(output, bb, DAV_XML_HEADER DEBUG_CR + SVN_ERR(dav_svn__brigade_printf( + bb, output, + DAV_XML_HEADER DEBUG_CR "<S:get-locations-report xmlns:S=\"" SVN_XML_NAMESPACE - "\" xmlns:D=\"DAV:\">" DEBUG_CR); - if (apr_err) - return apr_err; + "\" xmlns:D=\"DAV:\">" DEBUG_CR)); for (hi = apr_hash_first(pool, fs_locations); hi; hi = apr_hash_next(hi)) { @@ -70,24 +67,25 @@ send_get_locations_report(ap_filter_t *output, apr_hash_this(hi, &key, NULL, &value); path_quoted = apr_xml_quote_string(pool, value, 1); - apr_err = ap_fprintf(output, bb, "<S:location " + SVN_ERR(dav_svn__brigade_printf( + bb, output, "<S:location " "rev=\"%ld\" path=\"%s\"/>" DEBUG_CR, - *(const svn_revnum_t *)key, path_quoted); - if (apr_err) - return apr_err; + *(const svn_revnum_t *)key, path_quoted)); } - return ap_fprintf(output, bb, "</S:get-locations-report>" DEBUG_CR); + + SVN_ERR(dav_svn__brigade_printf(bb, output, + "</S:get-locations-report>" DEBUG_CR)); + return SVN_NO_ERROR; } dav_error * dav_svn__get_locations_report(const dav_resource *resource, const apr_xml_doc *doc, - ap_filter_t *output) + dav_svn__output *output) { svn_error_t *serr; dav_error *derr = NULL; - apr_status_t apr_err; apr_bucket_brigade *bb; dav_svn__authz_read_baton arb; @@ -112,12 +110,10 @@ dav_svn__get_locations_report(const dav_resource *resource, ns = dav_svn__find_ns(doc->namespaces, SVN_XML_NAMESPACE); if (ns == -1) { - return dav_svn__new_error_tag(resource->pool, HTTP_BAD_REQUEST, 0, + return dav_svn__new_error_svn(resource->pool, HTTP_BAD_REQUEST, 0, "The request does not contain the 'svn:' " "namespace, so it is not going to have " - "certain required elements.", - SVN_DAV_ERROR_NAMESPACE, - SVN_DAV_ERROR_TAG); + "certain required elements"); } /* Gather the parameters. */ @@ -154,10 +150,8 @@ dav_svn__get_locations_report(const dav_resource *resource, /* Check that all parameters are present and valid. */ if (! (abs_path && SVN_IS_VALID_REVNUM(peg_revision))) - return dav_svn__new_error_tag(resource->pool, HTTP_BAD_REQUEST, 0, - "Not all parameters passed.", - SVN_DAV_ERROR_NAMESPACE, - SVN_DAV_ERROR_TAG); + return dav_svn__new_error_svn(resource->pool, HTTP_BAD_REQUEST, 0, + "Not all parameters passed"); /* Build an authz read baton */ arb.r = resource->info->r; @@ -171,16 +165,17 @@ dav_svn__get_locations_report(const dav_resource *resource, if (serr) { - return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, - serr->message, resource->pool); + return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, NULL, + resource->pool); } - bb = apr_brigade_create(resource->pool, output->c->bucket_alloc); + bb = apr_brigade_create(resource->pool, + dav_svn__output_get_bucket_alloc(output)); - apr_err = send_get_locations_report(output, bb, resource, fs_locations); + serr = send_get_locations_report(output, bb, resource, fs_locations); - if (apr_err) - derr = dav_svn__convert_err(svn_error_create(apr_err, 0, NULL), + if (serr) + derr = dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, "Error writing REPORT response.", resource->pool); |