]> granicus.if.org Git - apache/commitdiff
Don't assume that the byterange filter will always be called more than
authorRyan Bloom <rbb@apache.org>
Sun, 25 Feb 2001 16:57:08 +0000 (16:57 +0000)
committerRyan Bloom <rbb@apache.org>
Sun, 25 Feb 2001 16:57:08 +0000 (16:57 +0000)
once.  It is perfectly legal to call the byterange filter one time,
with all the data.  Without this patch, that case will seg fault.
Submitted by: Ryan Morgan <rmogran@covalent.net>

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

CHANGES
modules/http/http_protocol.c

diff --git a/CHANGES b/CHANGES
index 430d5206aedeebd4cd33131c8a5ddcd8a4c2f6af..5aacf1133ccd3d3cdbbb5257623235207f4c1c98 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,15 @@
-Changes with Apache 2.0.12-dev
+Changes with Apache 2.0.13-dev
+
+  *) Don't assume that there will always be multiple calls to the byterange 
+     filter.  It is possible that we will need to do byteranges with only
+     one call to the filter.  [Ryan Morgan <rmorgan@covalent.net>]
 
   *) Move the error_bucket definition from the http module to the
      core server.  Every protocol will need this ability, not just
      HTTP.  [Ryan Bloom]
 
+Changes with Apache 2.0.12
+
   *) Modify mod_file_cache to save pre-formatted strings for 
      content-length and last-modified headers for performance. 
      [Mike Abbot <mja@trudge.engr.sgi.com>]
index 69834ac818ae25f3e5a59eca2ea57fd0099a9aaf..cb0290f0078380cde6569eb9d47993fdc9e3cdb0 100644 (file)
@@ -280,10 +280,14 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(
                              NULL);
     ap_xlate_proto_to_ascii(bound_head, strlen(bound_head));
 
-    /* concat the passed brigade with our saved brigade */
-    APR_BRIGADE_CONCAT(ctx->bb, bb);
-    bb = ctx->bb;
-    ctx->bb = NULL;     /* ### strictly necessary? call brigade_destroy? */
+    /* If we have a saved brigade from a previous run, concat the passed
+     * brigade with our saved brigade.  Otherwise just continue.  
+     */
+    if (ctx->bb) {
+        APR_BRIGADE_CONCAT(ctx->bb, bb);
+        bb = ctx->bb;
+        ctx->bb = NULL;     /* ### strictly necessary? call brigade_destroy? */
+    }
 
     /* It is possible that we won't have a content length yet, so we have to
      * compute the length before we can actually do the byterange work.