From: Yann Ylavic Date: Tue, 6 Oct 2015 16:22:24 +0000 (+0000) Subject: eor_bucket: don't destroy the request multiple times should any filter X-Git-Tag: 2.5.0-alpha~2754 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5ba68925157ef87c856421b4565608cda58c2f2;p=thirdparty%2Fapache%2Fhttpd.git 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 --- 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 };