diff options
author | Yann Ylavic <ylavic@apache.org> | 2018-07-16 11:20:26 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2018-07-16 11:20:26 +0000 |
commit | 823a630e809fc46481b3b9b8ce2f262cac084de7 (patch) | |
tree | 8198fe5ccee4b07f1f7cd11735fe3540ad77a45c /server/util_filter.c | |
parent | eb5e821beae8362ccc6b8b30d0d8a02d4131b8e1 (diff) | |
download | httpd-823a630e809fc46481b3b9b8ce2f262cac084de7.tar.gz |
util_filter: Axe conn_rec->empty brigade.
Since it's internal util_filter use, we shouldn't expose it in conn_rec and
can replace it with a pooled brigade provided by ap_reuse_brigade_from_pool().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836020 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/util_filter.c')
-rw-r--r-- | server/util_filter.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server/util_filter.c b/server/util_filter.c index ff36a13553..5474c31da1 100644 --- a/server/util_filter.c +++ b/server/util_filter.c @@ -1002,12 +1002,16 @@ AP_DECLARE(int) ap_filter_should_yield(ap_filter_t *f) AP_DECLARE_NONSTD(int) ap_filter_output_pending(conn_rec *c) { int data_in_output_filters = DECLINED; + apr_bucket_brigade *bb; ap_filter_t *f; if (!c->pending_filters) { return DECLINED; } + bb = ap_reuse_brigade_from_pool("ap_fop_bb", c->pool, + c->bucket_alloc); + for (f = APR_RING_FIRST(c->pending_filters); f != APR_RING_SENTINEL(c->pending_filters, ap_filter_t, pending); f = APR_RING_NEXT(f, pending)) { @@ -1015,9 +1019,10 @@ AP_DECLARE_NONSTD(int) ap_filter_output_pending(conn_rec *c) && !APR_BRIGADE_EMPTY(f->bb)) { apr_status_t rv; - rv = ap_pass_brigade(f, c->empty); - apr_brigade_cleanup(c->empty); - if (rv != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(rv)) { + rv = ap_pass_brigade(f, bb); + apr_brigade_cleanup(bb); + + if (rv != APR_SUCCESS) { ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, c, APLOGNO(00470) "write failure in '%s' output filter", f->frec->name); return rv; |