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);
}
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)