Factorized helper function: prep request_rec R for a multistatus response and write tag into BB, destined for R->output_filters. Use xml NAMESPACES in initial tag, if non-NULL. */
| 546 | R->output_filters. Use xml NAMESPACES in initial tag, if |
| 547 | non-NULL. */ |
| 548 | DAV_DECLARE(void) dav_begin_multistatus(apr_bucket_brigade *bb, |
| 549 | request_rec *r, int status, |
| 550 | apr_array_header_t *namespaces) |
| 551 | { |
| 552 | /* Set the correct status and Content-Type */ |
| 553 | r->status = status; |
| 554 | ap_set_content_type_ex(r, DAV_XML_CONTENT_TYPE, 1); |
| 555 | |
| 556 | /* Send the headers and actual multistatus response now... */ |
| 557 | ap_fputs(r->output_filters, bb, DAV_XML_HEADER DEBUG_CR |
| 558 | "<D:multistatus xmlns:D=\"DAV:\""); |
| 559 | |
| 560 | if (namespaces != NULL) { |
| 561 | int i; |
| 562 | |
| 563 | for (i = namespaces->nelts; i--; ) { |
| 564 | ap_fprintf(r->output_filters, bb, " xmlns:ns%d=\"%s\"", i, |
| 565 | APR_XML_GET_URI_ITEM(namespaces, i)); |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | ap_fputs(r->output_filters, bb, ">" DEBUG_CR); |
| 570 | } |
| 571 | |
| 572 | /* Finish a multistatus response started by dav_begin_multistatus: */ |
| 573 | DAV_DECLARE(apr_status_t) dav_finish_multistatus(request_rec *r, |
no test coverage detected