diff options
author | Yann Ylavic <ylavic@apache.org> | 2018-07-16 13:06:57 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2018-07-16 13:06:57 +0200 |
commit | eb5e821beae8362ccc6b8b30d0d8a02d4131b8e1 (patch) | |
tree | 877f2536acd57602e1e77b5d2784477f09aa9af9 /server/request.c | |
parent | util_filter: follow up to r1835640: pending_filter_cleanup() precedence. (diff) | |
download | apache2-eb5e821beae8362ccc6b8b30d0d8a02d4131b8e1.tar.xz apache2-eb5e821beae8362ccc6b8b30d0d8a02d4131b8e1.zip |
core: Add ap_reuse_brigade_from_pool().
Current RETRIEVE_BRIGADE_FROM_POOL macro from "http_request.c" is turned into
a helper and used in ap_request_core_filter().
We will need it in a subsequent commit in "util_filter.c" too.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836018 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/request.c')
-rw-r--r-- | server/request.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/server/request.c b/server/request.c index 1297cf007e..926148cf73 100644 --- a/server/request.c +++ b/server/request.c @@ -2081,13 +2081,8 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_request_core_filter(ap_filter_t *f, } if (!tmp_bb) { - const char *tmp_bb_key = "ap_request_core_filter_bb"; - tmp_bb = (void *)apr_table_get(f->c->notes, tmp_bb_key); - if (!tmp_bb) { - tmp_bb = apr_brigade_create(f->c->pool, f->c->bucket_alloc); - apr_table_setn(f->c->notes, tmp_bb_key, (void *)tmp_bb); - } - f->ctx = tmp_bb; + f->ctx = tmp_bb = ap_reuse_brigade_from_pool("ap_rcf_bb", f->c->pool, + f->c->bucket_alloc); } /* Reinstate any buffered content */ @@ -2137,13 +2132,12 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_request_core_filter(ap_filter_t *f, } status = ap_pass_brigade(f->next, tmp_bb); + apr_brigade_cleanup(tmp_bb); + if (seen_eor || (status != APR_SUCCESS && !APR_STATUS_IS_EOF(status))) { - apr_brigade_cleanup(tmp_bb); return status; } - - apr_brigade_cleanup(tmp_bb); } return ap_filter_setaside_brigade(f, bb); |