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 /modules | |
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 'modules')
-rw-r--r-- | modules/http/http_core.c | 2 | ||||
-rw-r--r-- | modules/http/http_request.c | 11 |
2 files changed, 2 insertions, 11 deletions
diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 746cf704a7..3f87f80f95 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -268,8 +268,6 @@ static int http_create_request(request_rec *r) NULL, r, r->connection); ap_add_output_filter_handle(ap_http_outerror_filter_handle, NULL, r, r->connection); - ap_add_output_filter_handle(ap_request_core_filter_handle, - NULL, r, r->connection); } return OK; diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 15c1fd5124..a5fdaf44f9 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -350,7 +350,6 @@ AP_DECLARE(void) ap_process_request_after_handler(request_rec *r) apr_bucket_brigade *bb; apr_bucket *b; conn_rec *c = r->connection; - ap_filter_t *f; bb = ap_acquire_brigade(c); @@ -371,15 +370,9 @@ AP_DECLARE(void) ap_process_request_after_handler(request_rec *r) /* All the request filters should have bailed out on EOS, and in any * case they shouldn't have to handle this EOR which will destroy the - * request underneath them. So go straight to the core request filter - * which (if any) will take care of the setaside buckets. + * request underneath them. So go straight to the connection filters. */ - for (f = r->output_filters; f; f = f->next) { - if (f->frec == ap_request_core_filter_handle) { - break; - } - } - ap_pass_brigade(f ? f : c->output_filters, bb); + ap_pass_brigade(c->output_filters, bb); /* The EOR bucket has either been handled by an output filter (eg. * deleted or moved to a buffered_bb => no more in bb), or an error |