]> granicus.if.org Git - apache/commitdiff
Always clear the C-L if we are going to try to parse the file. It is
authorRyan Bloom <rbb@apache.org>
Thu, 8 Mar 2001 20:03:37 +0000 (20:03 +0000)
committerRyan Bloom <rbb@apache.org>
Thu, 8 Mar 2001 20:03:37 +0000 (20:03 +0000)
impossible for us to determine if there is going to be an SSI tag in the
file until we have actually scanned it all.  By that time, it is likely
that the first chunk of data, and the headers have been sent to the client,
and it is too late to clear the C-L.  If we are parsing the file, we have
to just assume we are going to change the content.

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

CHANGES
modules/filters/mod_include.c

diff --git a/CHANGES b/CHANGES
index 0213536d7548cf3454dab5bbec155e8966b9d572..67bf199dff88216467e457ecce7f23415c888570 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
 Changes with Apache 2.0.14
 
+  *) Mod_include should always unset the content-length if the file is
+     going to be passed through send_parsed_content.  There is no to
+     determine if the content will change before actually scanning the
+     entire content.  It is far safer to just remove the C-L as long
+     as we are scanning it.  [Ryan Bloom]
+
   *) 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]
index e94815cd0b9631c052fd9b0616370c777625cc60..4cdf5035a3402a63d1ffbe059ead3608a38b3dd3 100644 (file)
@@ -2497,13 +2497,6 @@ static void send_parsed_content(apr_bucket_brigade **bb, request_rec *r,
                 return;
             }
 
-            /* Even if I don't generate any content, I know at this point that
-             *   I will at least remove the discovered SSI tag, thereby making
-             *   the content shorter than it was. This is the safest point I can
-             *   find to unset this field.
-             */
-            apr_table_unset(f->r->headers_out, "Content-Length");
-
             /* Can't destroy the tag buckets until I'm done processing
              *  because the combined_tag might just be pointing to
              *  the contents of a single bucket!
@@ -2777,6 +2770,15 @@ static int includes_filter(ap_filter_t *f, apr_bucket_brigade *b)
      */
 
 
+    /* Always unset the content-length.  There is no way to know if
+     * the content will be modified at some point by send_parsed_content.
+     * It is very possible for us to not find any content in the first
+     * 9k of the file, but still have to modify the content of the file.
+     * If we are going to pass the file through send_parsed_content, then
+     * the content-length should just be unset.
+     */
+    apr_table_unset(f->r->headers_out, "Content-Length");
+
     send_parsed_content(&b, r, f);
 
     if (parent) {