From: Yann Ylavic Date: Tue, 30 Jan 2018 02:00:33 +0000 (+0000) Subject: core: don't send EOR bucket through request filters. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c73d594ccc91a0647acfae324f53c2fab45547c3;p=apache core: don't send EOR bucket through request filters. The core request filter is the only one which should take care of it. In theory the other request filters should have bailed out on EOS already, but that's not always the case (and even less the case on error). So be safe by not sending them a bucket which may destroy the request (and their brigade) underneath them. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822600 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 85c65707a2..986ac9d278 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -346,6 +346,7 @@ AP_DECLARE(void) ap_process_request_after_handler(request_rec *r) apr_bucket *b; conn_rec *c = r->connection; apr_status_t rv; + ap_filter_t *f; /* Send an EOR bucket through the output filter chain. When * this bucket is destroyed, the request will be logged and @@ -363,7 +364,17 @@ AP_DECLARE(void) ap_process_request_after_handler(request_rec *r) r = r->next; } - ap_pass_brigade(r->output_filters, bb); + /* 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. + */ + 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); /* 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