]> granicus.if.org Git - apache/commitdiff
The content-length filter needs to compute the length even if the
authorRyan Bloom <rbb@apache.org>
Thu, 9 Nov 2000 03:00:00 +0000 (03:00 +0000)
committerRyan Bloom <rbb@apache.org>
Thu, 9 Nov 2000 03:00:00 +0000 (03:00 +0000)
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

modules/http/http_protocol.c

index b440b4e69f3b4d3929ec4140cce212959aaf878b..d002027ca3154fe04d53560a87ead8dce9089964 100644 (file)
@@ -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 {