diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 28580c67db..21af994271 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -256,14 +256,6 @@ AP_DECLARE(void) ap_process_request_after_handler(request_rec *r) apr_bucket *b; conn_rec *c = r->connection; - /* Find the last request, taking into account internal - * redirects. We want to send the EOR bucket at the end of - * all the buckets so it does not jump the queue. - */ - while (r->next) { - r = r->next; - } - /* Send an EOR bucket through the output filter chain. When * this bucket is destroyed, the request will be logged and * its pool will be freed @@ -272,6 +264,14 @@ AP_DECLARE(void) ap_process_request_after_handler(request_rec *r) b = ap_bucket_eor_create(c->bucket_alloc, r); APR_BRIGADE_INSERT_HEAD(bb, b); + /* Find the last request, taking into account internal + * redirects. We want to send the EOR bucket at the end of + * all the buckets so it does not jump the queue. + */ + while (r->next) { + r = r->next; + } + ap_pass_brigade(r->output_filters, bb); /* The EOR bucket has either been handled by an output filter (eg.