]> granicus.if.org Git - apache/commitdiff
core: don't send EOR bucket through request filters.
authorYann Ylavic <ylavic@apache.org>
Tue, 30 Jan 2018 02:00:33 +0000 (02:00 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 30 Jan 2018 02:00:33 +0000 (02:00 +0000)
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

modules/http/http_request.c

index 85c65707a2016eac98d624ff74e9f794ab1d2982..986ac9d2785519852b42178354a24804c5807cc2 100644 (file)
@@ -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