]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
core: always allocate filters (ap_filter_t) on f->c->pool.
authorYann Ylavic <ylavic@apache.org>
Mon, 3 Sep 2018 23:49:46 +0000 (23:49 +0000)
committerYann Ylavic <ylavic@apache.org>
Mon, 3 Sep 2018 23:49:46 +0000 (23:49 +0000)
commit0a61dd979a60a09c80234e6dea3ad69e357d43d1
treefd649ce591ad54314af6cdeb4a897db0a07a82c5
parentef4b1394d82560ce48b0e72f2ee674a732f8a5a1
core: always allocate filters (ap_filter_t) on f->c->pool.

When filters are allocated on f->r->pool, they may be destroyed any time
underneath themselves which makes it hard for them to be passed the EOR and
forward it (*f can't be dereferenced anymore when the EOR is destroyed, thus
before request filters return).

On the util_filter side, it also makes it impossible to flush pending request
filters when they have set aside the EOR, since f->bb can't be accessed after
it's passed to the f->next.

So we always use f->c->pool to allocate filters and pending brigades, and to
avoid leaks with keepalive requests (long living connections handling multiple
requests), filters and brigades are recycled with a cleanup on f->r->pool.

Recycling is done (generically) with a spare data ring (void pointers), and a
filter(s) context struct is associated with the conn_rec to maintain the rings
by connection, that is:

    struct ap_filter_conn_ctx {
        struct ap_filter_ring *pending_input_filters;
        struct ap_filter_ring *pending_output_filters;

        struct ap_filter_spare_ring *spare_containers,
                                    *spare_brigades,
                                    *spare_filters,
                                    *spare_flushes;
        int flushing;
    };

MMN major bumped (again).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1839997 13f79535-47bb-0310-9956-ffa450edef68
include/ap_mmn.h
include/httpd.h
include/util_filter.h
modules/http2/h2_conn.c
modules/ssl/ssl_engine_io.c
server/core.c
server/core_filters.c
server/util_filter.c