]> granicus.if.org Git - apache/commitdiff
Fix content-length computation. We ONLY compute a content-length if
authorRyan Bloom <rbb@apache.org>
Wed, 7 Mar 2001 17:01:28 +0000 (17:01 +0000)
committerRyan Bloom <rbb@apache.org>
Wed, 7 Mar 2001 17:01:28 +0000 (17:01 +0000)
We are not in a 1.1 request and we cannot chunk, and this is a keepalive
or we already have all the data.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88464 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/protocol.c

diff --git a/CHANGES b/CHANGES
index 1026446531cf77ad1d0378fcfbaba4d5261471e3..dc3aff64050eb5b48572f142c86128781fa59832 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.14-dev
 
+  *) Fix content-length computation.  We ONLY compute a content-length if
+     We are not in a 1.1 request and we cannot chunk, and this is a keepalive
+     or we already have all the data.  [Ryan Bloom]
+
   *) Report unbounded containers in the config file.  Previously, a typo
      in the </container> directive could result in the rest of the config
      file being silently ignored, with undesired defaults used.
index 0bfd0ded904ae4cc52ea34ad4c74cb8c27961eef..b6838b44241a42a942829e1bf1c92bf799f5fdb4 100644 (file)
@@ -1176,20 +1176,20 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *f,
     }
 
     /* We will compute a content length if:
-     *     We already have all the data
+     *     The protocol is < 1.1
+     * and We can not chunk
+     * and this is a keepalive request.
+     * or  We already have all the data
      *         This is a bit confusing, because we will always buffer up
      *         to AP_MIN_BYTES_TO_WRITE, so if we get all the data while
      *         we are buffering that much data, we set the c-l.
-     *  or We are in a 1.1 request and we can't chunk
-     *  or This is a keepalive connection
-     *         We may want to change this later to just close the connection
      */
-    if ((r->proto_num == HTTP_VERSION(1,1)
-        && !ap_find_last_token(f->r->pool,
+    if ((r->proto_num < HTTP_VERSION(1,1)
+        && (!ap_find_last_token(f->r->pool,
                                apr_table_get(r->headers_out,
                                              "Transfer-Encoding"),
-                               "chunked"))
-        || (f->r->connection->keepalive)
+                               "chunked")
+        && (f->r->connection->keepalive)))
         || (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(b)))) {
         ctx->compute_len = 1;
     }