From 6777364613148c8d39f5520aba92d9475e9302c4 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 10 Dec 2008 13:01:31 +0000 Subject: [PATCH] =?utf8?q?Hopefully=20the=20final=20fix=20for=20the=20subr?= =?utf8?q?eq/filter=20issue.=20The=20prob=20was=20that=20we=20at=20this=20?= =?utf8?q?point=20could=20still=20have=20some=20stale=20and=20incorrect=20?= =?utf8?q?refs=20when=20we=20adjusted=20the=20f-stack.=20So=20move=20the?= =?utf8?q?=20update=20earlier=20so=20when=20we=20adjust,=20we're=20affecti?= =?utf8?q?ng=20r.=20R=C2=9Fdiger=20and=20Jim=20pretty=20much=20simultaneou?= =?utf8?q?sly=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@725077 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_request.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/http/http_request.c b/modules/http/http_request.c index fed313bee9..4da05d2ba0 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -518,6 +518,15 @@ AP_DECLARE(void) ap_internal_fast_redirect(request_rec *rr, request_rec *r) r->output_filters = rr->output_filters; r->input_filters = rr->input_filters; + /* If any filters pointed at the now-defunct rr, we must point them + * at our "new" instance of r. In particular, some of rr's structures + * will now be bogus (say rr->headers_out). If a filter tried to modify + * their f->r structure when it is pointing to rr, the real request_rec + * will not get updated. Fix that here. + */ + update_r_in_filters(r->input_filters, rr, r); + update_r_in_filters(r->output_filters, rr, r); + if (r->main) { ap_add_output_filter_handle(ap_subreq_core_filter_handle, NULL, r, r->connection); @@ -541,20 +550,8 @@ AP_DECLARE(void) ap_internal_fast_redirect(request_rec *rr, request_rec *r) } if (next && (next->frec == ap_subreq_core_filter_handle)) { ap_remove_output_filter(next); - if (next == r->output_filters) { - r->output_filters = r->output_filters->next; - } } } - - /* If any filters pointed at the now-defunct rr, we must point them - * at our "new" instance of r. In particular, some of rr's structures - * will now be bogus (say rr->headers_out). If a filter tried to modify - * their f->r structure when it is pointing to rr, the real request_rec - * will not get updated. Fix that here. - */ - update_r_in_filters(r->input_filters, rr, r); - update_r_in_filters(r->output_filters, rr, r); } AP_DECLARE(void) ap_internal_redirect(const char *new_uri, request_rec *r) -- 2.40.0