diff options
author | Yann Ylavic <ylavic@apache.org> | 2020-03-31 18:22:53 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2020-03-31 18:22:53 +0200 |
commit | b3110d36afaceab45e083a68b1a8493b8244af2a (patch) | |
tree | 1c576b7cb58567b17f184173736429e4286b96c3 /server/core.c | |
parent | Adds additional clarification, as requested in bz64167 (diff) | |
download | apache2-b3110d36afaceab45e083a68b1a8493b8244af2a.tar.xz apache2-b3110d36afaceab45e083a68b1a8493b8244af2a.zip |
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
Diffstat (limited to 'server/core.c')
-rw-r--r-- | server/core.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/server/core.c b/server/core.c index 0fc4a8ef97..3a00761b76 100644 --- a/server/core.c +++ b/server/core.c @@ -122,7 +122,6 @@ AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, insert_network_bucket, /* Handles for core filters */ AP_DECLARE_DATA ap_filter_rec_t *ap_subreq_core_filter_handle; -AP_DECLARE_DATA ap_filter_rec_t *ap_request_core_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_core_output_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_content_length_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle; @@ -5916,9 +5915,6 @@ static void register_hooks(apr_pool_t *p) ap_core_output_filter_handle = ap_register_output_filter("CORE", ap_core_output_filter, NULL, AP_FTYPE_NETWORK); - ap_request_core_filter_handle = - ap_register_output_filter("REQ_CORE", ap_request_core_filter, - NULL, AP_FTYPE_CONNECTION - 1); ap_subreq_core_filter_handle = ap_register_output_filter("SUBREQ_CORE", ap_sub_req_output_filter, NULL, AP_FTYPE_CONTENT_SET); |