]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
core: handle morphing buckets setaside/reinstate and kill request core filter.
authorYann Ylavic <ylavic@apache.org>
Tue, 31 Mar 2020 16:22:53 +0000 (16:22 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 31 Mar 2020 16:22:53 +0000 (16:22 +0000)
commitb3110d36afaceab45e083a68b1a8493b8244af2a
tree1c576b7cb58567b17f184173736429e4286b96c3
parent0121b9eb7e634f50ab23585e2983c22077fdf6a0
core: handle morphing buckets setaside/reinstate and kill request core filter.

The purpose of ap_request_core_filter() is not clear, it seems to prevent
potential morphing buckets to go through AP_FTYPE_CONNECTION filters which
would fail to set them aside (ENOTIMPL), and read them (unbounded) in memory.

This patch allows ap_filter_setaside_brigade() to set morphing buckets aside
by simply moving them, assuming they have the correct lifetime (either until
some further EOR, or the connection lifetime, or whatever). IOW, the module is
responsible for sending morphing buckets whose lifetime needs not be changed
by the connection filters.

Now since morphing buckets consume no memory until (apr_bucket_)read, like FILE
buckets, we don't account for them in flush_max_threshold either. This changes
ap_filter_reinstate_brigade() to only account for in-memory and EOR buckets to
flush_upto.

Also, since the EOR bucket is sent only to c->output_filters once the request
is processed, when all the filters < AP_FTYPE_CONNECTION have done their job
and stopped retaining data (after the EOS bucket, if ever), we prevent misuse
of ap_filter_{setaside,reinstate}_brigade() outside connection filters by
returning ENOTIMPL. This is not the right API for request filters as of now.

Finally, ap_request_core_filter() and co can be removed.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1875947 13f79535-47bb-0310-9956-ffa450edef68
include/http_request.h
modules/http/http_core.c
modules/http/http_request.c
server/core.c
server/core_filters.c
server/request.c
server/util_filter.c