mirror of
https://github.com/apache/httpd.git
synced 2026-01-26 19:01:35 +03:00
Change the REPORT handling APIs to deliver the content directly into
the filter stack, rather than buffering everything into memory(!). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94003 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -3868,7 +3868,6 @@ static int dav_method_report(request_rec *r)
|
||||
int result;
|
||||
int label_allowed;
|
||||
ap_xml_doc *doc;
|
||||
ap_text_header hdr = { 0 };
|
||||
ap_text *t;
|
||||
dav_error *err;
|
||||
|
||||
@@ -3900,23 +3899,17 @@ static int dav_method_report(request_rec *r)
|
||||
return HTTP_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* run report hook */
|
||||
/* ### writing large reports to memory could be bad...
|
||||
* ### but if provider generated output directly, it would
|
||||
* ### have to handle error responses as well.
|
||||
*/
|
||||
if ((err = (*vsn_hooks->get_report)(r, resource, doc, &hdr)) != NULL)
|
||||
return dav_handle_err(r, err, NULL);
|
||||
|
||||
/* send the report response */
|
||||
/* set up defaults for the report response */
|
||||
r->status = HTTP_OK;
|
||||
r->content_type = DAV_XML_CONTENT_TYPE;
|
||||
|
||||
/* send the headers and response body */
|
||||
ap_rputs(DAV_XML_HEADER DEBUG_CR, r);
|
||||
|
||||
for (t = hdr.first; t != NULL; t = t->next)
|
||||
ap_rputs(t->text, r);
|
||||
/* run report hook */
|
||||
if ((err = (*vsn_hooks->deliver_report)(r, resource, doc,
|
||||
r->output_filters)) != NULL) {
|
||||
/* NOTE: we're assuming that the provider has not generated any
|
||||
content yet! */
|
||||
return dav_handle_err(r, err, NULL);
|
||||
}
|
||||
|
||||
return DONE;
|
||||
}
|
||||
|
||||
@@ -2169,15 +2169,23 @@ struct dav_hooks_vsn
|
||||
** must be passed to this routine.
|
||||
**
|
||||
** The dav_xml_doc structure contains the parsed report request
|
||||
** body. The report response is generated into the ap_text_header
|
||||
** structure.
|
||||
** body. The report response should be generated into the specified
|
||||
** output filter.
|
||||
**
|
||||
** ### shouldn't generate large responses to memory ###
|
||||
** If an error occurs, and a response has not yet been generated,
|
||||
** then an error can be returned from this function. mod_dav will
|
||||
** construct an appropriate error response. Once some output has
|
||||
** been placed into the filter, however, the provider should not
|
||||
** return an error -- there is no way that mod_dav can deliver it
|
||||
** properly.
|
||||
**
|
||||
** ### maybe we need a way to signal an error anyways, and then
|
||||
** ### apache can abort the connection?
|
||||
*/
|
||||
dav_error * (*get_report)(request_rec *r,
|
||||
const dav_resource *resource,
|
||||
const ap_xml_doc *doc,
|
||||
ap_text_header *report);
|
||||
dav_error * (*deliver_report)(request_rec *r,
|
||||
const dav_resource *resource,
|
||||
const ap_xml_doc *doc,
|
||||
ap_filter_t *output);
|
||||
|
||||
/*
|
||||
** OPTIONAL HOOKS
|
||||
|
||||
Reference in New Issue
Block a user