From: Ryan Bloom Date: Thu, 9 Nov 2000 03:00:00 +0000 (+0000) Subject: The content-length filter needs to compute the length even if the X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1615954b5b26522de1aef7cae6529526aabc1467;p=apache The content-length filter needs to compute the length even if the content-length has already been set. If we don't, then we won't know if the content-length has changed because some other filter changed the length of the actual data. We also ALWAYS want to calculate the content length if we get the whole brigade in the first call to this function. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86879 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index b440b4e69f..d002027ca3 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -2237,16 +2237,16 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *f, * . body already chunked * Much of this should correspond to checks in ap_set_keepalive(). */ - if (r->assbackwards + if ((r->assbackwards || r->status == HTTP_NOT_MODIFIED || r->status == HTTP_NO_CONTENT || r->header_only - || apr_table_get(r->headers_out, "Content-Length") || r->proto_num == HTTP_VERSION(1,1) || ap_find_last_token(f->r->pool, apr_table_get(r->headers_out, "Transfer-Encoding"), - "chunked")) { + "chunked")) + && (!AP_BUCKET_IS_EOS(AP_BRIGADE_LAST(b)))) { ctx->hold_data = 0; } else {