From: Sander Striker Date: Sat, 9 Apr 2005 23:55:25 +0000 (+0000) Subject: Backport. X-Git-Tag: 2.0.54~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6918283eec4a881d77aa398a63ecc152aca0adef;p=thirdparty%2Fapache%2Fhttpd.git Backport. * STATUS Remove backport vote. * modules/dav/main/mod_dav.c (dav_finish_multistatus, dav_send_multistatus, dav_method_propfind): Send an EOS at the end of the multistatus brigade. http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/dav/main/mod_dav.c?r1=1.105&r2=1.106 +1: jorton, jerenkrantz, pquerna nd asks: Sure, you want to drop the return code of ap_pass_brigade? jerenkrantz: They already did drop it. Note that this really isn't a correctness fix; just a perf. fix. We'd send the EOS later without it. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@160723 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 6fb025a69bd..44d5d4c45f1 100644 --- a/STATUS +++ b/STATUS @@ -153,14 +153,6 @@ PATCHES TO BACKPORT FROM TRUNK: have already. *shrug* Regardless, patch looks okay... +1: nd, jerenkrantz - *) mod_dav: Send an EOS at the end of the multistatus brigade. - http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/dav/main/mod_dav.c?r1=1.105&r2=1.106 - +1: jorton, jerenkrantz, pquerna - nd asks: Sure, you want to drop the return code of ap_pass_brigade? - jerenkrantz: They already did drop it. Note that this really isn't - a correctness fix; just a perf. fix. We'd send the EOS - later without it. - * Rewrite how proxy sends its request to allow input bodies to morph the request bodies. Previously, if an input filter changed the request body, the original C-L would be sent which diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index adb673077bf..cbd212d7829 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -509,6 +509,21 @@ static void dav_begin_multistatus(apr_bucket_brigade *bb, ap_fputs(r->output_filters, bb, ">" DEBUG_CR); } +/* Finish a multistatus response started by dav_begin_multistatus: */ +static apr_status_t dav_finish_multistatus(request_rec *r, + apr_bucket_brigade *bb) +{ + apr_bucket *b; + + ap_fputs(r->output_filters, bb, "" DEBUG_CR); + + /* indicate the end of the response body */ + b = apr_bucket_eos_create(r->connection->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, b); + + /* deliver whatever might be remaining in the brigade */ + return ap_pass_brigade(r->output_filters, bb); +} static void dav_send_multistatus(request_rec *r, int status, dav_response *first, @@ -528,8 +543,7 @@ static void dav_send_multistatus(request_rec *r, int status, } apr_pool_destroy(subpool); - ap_fputs(r->output_filters, bb, "" DEBUG_CR); - ap_filter_flush(bb, r->output_filters); + dav_finish_multistatus(r, bb); } /* @@ -2049,8 +2063,7 @@ static int dav_method_propfind(request_rec *r) return DONE; } - /* Finish up the multistatus response. */ - ap_fputs(r->output_filters, ctx.bb, "" DEBUG_CR); + dav_finish_multistatus(r, ctx.bb); ap_filter_flush(ctx.bb, r->output_filters); /* the response has been sent. */