Commit dc54a766 authored by Yann Ylavic's avatar Yann Ylavic
Browse files

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
parent f6c93f27
Loading
Loading
Loading
Loading
+3 −2
Changes for include/ap_mmn.h: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -581,14 +581,15 @@
 *                         conn_rec, and add ring entry 'pending' in struct
 *                         ap_filter_t
 * 20180711.2 (2.5.1-dev)  Add ap_reuse_brigade_from_pool()
 * 20180716.1 (2.5.1-dev)  Axe conn_rec->empty brigade
 */

#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */

#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20180711
#define MODULE_MAGIC_NUMBER_MAJOR 20180716
#endif
#define MODULE_MAGIC_NUMBER_MINOR 2                 /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 1                 /* 0...n */

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+0 −3
Changes for include/httpd.h: 0 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -1221,9 +1221,6 @@ struct conn_rec {
    /** Array of requests being handled under this connection. */
    apr_array_header_t *requests;

    /** Empty bucket brigade */
    apr_bucket_brigade *empty;

    /** Ring of pending filters (with setaside buckets) */
    struct ap_filter_ring *pending_filters;

+0 −1
Changes for server/core.c: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -5325,7 +5325,6 @@ static conn_rec *core_create_conn(apr_pool_t *ptrans, server_rec *s,

    c->id = id;
    c->bucket_alloc = alloc;
    c->empty = apr_brigade_create(c->pool, c->bucket_alloc);
    c->async_filter = sconf->async_filter;

    c->clogging_input_filters = 0;
+8 −3
Changes for server/util_filter.c: 8 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -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;