MCPcopy Create free account
hub / github.com/apache/httpd / dav_send_one_response

Function dav_send_one_response

modules/dav/main/mod_dav.c:486–541  ·  view source on GitHub ↗

Write a complete RESPONSE object out as a xml element. Data is sent into brigade BB, which is auto-flushed into the output filter stack for request R. Use POOL for any temporary allocations. [Presumably the tag has already been written; this routine is shared by dav_send_multistatus and dav_stream_response.] */

Source from the content-addressed store, hash-verified

484 routine is shared by dav_send_multistatus and dav_stream_response.]
485*/
486DAV_DECLARE(void) dav_send_one_response(dav_response *response,
487 apr_bucket_brigade *bb,
488 request_rec *r,
489 apr_pool_t *pool)
490{
491 apr_text *t = NULL;
492
493 if (response->propresult.xmlns == NULL) {
494 ap_fputs(r->output_filters, bb, "<D:response>");
495 }
496 else {
497 ap_fputs(r->output_filters, bb, "<D:response");
498 for (t = response->propresult.xmlns; t; t = t->next) {
499 ap_fputs(r->output_filters, bb, t->text);
500 }
501 ap_fputc(r->output_filters, bb, '>');
502 }
503
504 ap_fputstrs(r->output_filters, bb,
505 DEBUG_CR "<D:href>",
506 dav_xml_escape_uri(pool, response->href),
507 "</D:href>" DEBUG_CR,
508 NULL);
509
510 if (response->propresult.propstats == NULL) {
511 /* use the Status-Line text from Apache. Note, this will
512 * default to 500 Internal Server Error if first->status
513 * is not a known (or valid) status code.
514 */
515 ap_fputstrs(r->output_filters, bb,
516 "<D:status>HTTP/1.1 ",
517 ap_get_status_line(response->status),
518 "</D:status>" DEBUG_CR,
519 NULL);
520 }
521 else {
522 /* assume this includes <propstat> and is quoted properly */
523 for (t = response->propresult.propstats; t; t = t->next) {
524 ap_fputs(r->output_filters, bb, t->text);
525 }
526 }
527
528 if (response->desc != NULL) {
529 /*
530 * We supply the description, so we know it doesn't have to
531 * have any escaping/encoding applied to it.
532 */
533 ap_fputstrs(r->output_filters, bb,
534 "<D:responsedescription>",
535 response->desc,
536 "</D:responsedescription>" DEBUG_CR,
537 NULL);
538 }
539
540 ap_fputs(r->output_filters, bb, "</D:response>" DEBUG_CR);
541}
542
543

Callers 3

dav_send_multistatusFunction · 0.85
dav_stream_responseFunction · 0.85
mod_dav.hFile · 0.85

Calls 3

ap_fputstrsFunction · 0.85
dav_xml_escape_uriFunction · 0.85
ap_get_status_lineFunction · 0.85

Tested by

no test coverage detected