]> granicus.if.org Git - apache/commitdiff
Fix the byterange filter for the case where the bucket can't be
authorRyan Bloom <rbb@apache.org>
Tue, 23 Jan 2001 07:30:11 +0000 (07:30 +0000)
committerRyan Bloom <rbb@apache.org>
Tue, 23 Jan 2001 07:30:11 +0000 (07:30 +0000)
copied natively.  This will only ever happen if a bucket can be split
but not copied, because we read the bucket in apr_brigade_partition if
we can't split it.  Regardless, this is much safer.  This should also fix
all of the problems with the byterange filter.

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

modules/http/http_protocol.c

index f64a1d9ef3a9d0a09808f2e7257e793fe91e6f0b..c0b8da5c09889f1edf6b876c8f8c877b1a8e1c2c 100644 (file)
@@ -325,7 +325,13 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(
         ec = e;
         do {
             apr_bucket *foo;
-            apr_bucket_copy(ec, &foo);
+            const char *str;
+            apr_size_t len;
+
+            if (apr_bucket_copy(ec, &foo) != APR_SUCCESS) {
+                apr_bucket_read(ec, &str, &len, APR_BLOCK_READ);
+                foo = apr_bucket_create_heap(str, len, 0, NULL);
+            }
             APR_BRIGADE_INSERT_TAIL(bsend, foo);
             ec = APR_BUCKET_NEXT(ec);
         } while (ec != e2);