int result;
int label_allowed;
ap_xml_doc *doc;
- ap_text_header hdr = { 0 };
ap_text *t;
dav_error *err;
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;
}
** 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.
- **
- ** ### shouldn't generate large responses to memory ###
+ ** body. The report response should be generated into the specified
+ ** output filter.
+ **
+ ** 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