]> granicus.if.org Git - apache/commitdiff
eor_bucket: don't destroy the request multiple times should any filter
authorYann Ylavic <ylavic@apache.org>
Tue, 6 Oct 2015 16:22:24 +0000 (16:22 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 6 Oct 2015 16:22:24 +0000 (16:22 +0000)
do a copy (e.g. mod_bucketeer).

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

server/eor_bucket.c

index 4d3e1ecfbed6776f36330550141db73be501d9bd..c7f1862281a988f78a9ee9f85120d994963c72c9 100644 (file)
@@ -91,12 +91,23 @@ static void eor_bucket_destroy(void *data)
     }
 }
 
+static apr_status_t eor_bucket_copy(apr_bucket *a, apr_bucket **b)
+{
+    *b = apr_bucket_alloc(sizeof(**b), a->list); /* XXX: check for failure? */
+    **b = *a;
+
+    /* we don't wan't the request to be destroyed twice */
+    (*b)->data = NULL;
+
+    return APR_SUCCESS;
+}
+
 AP_DECLARE_DATA const apr_bucket_type_t ap_bucket_type_eor = {
     "EOR", 5, APR_BUCKET_METADATA,
     eor_bucket_destroy,
     eor_bucket_read,
     apr_bucket_setaside_noop,
     apr_bucket_split_notimpl,
-    apr_bucket_simple_copy
+    eor_bucket_copy
 };