mirror of
https://github.com/apache/httpd.git
synced 2025-08-15 23:27:39 +00:00
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
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user