From b5ba68925157ef87c856421b4565608cda58c2f2 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 6 Oct 2015 16:22:24 +0000 Subject: [PATCH] eor_bucket: don't destroy the request multiple times should any filter 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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server/eor_bucket.c b/server/eor_bucket.c index 4d3e1ecfbed..c7f1862281a 100644 --- a/server/eor_bucket.c +++ b/server/eor_bucket.c @@ -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 }; -- 2.47.3