We have an essential problem in filters ... the protocol level filters are
added by the original request. Protocol filters that reflect the f->r member
seem to be hosed when an internal_internal_redirect() is passed down the
filter stack.
Ryan and I discussed, he's thinking in terms of fixing the r->output_headers
to reflect r->next->output_headers. I'm thinking more in terms of 'repairing'
the filter stack to indicate the correct, internallly redirected new request.
If someone has the entire test suite handy, please try this attached patch
which fixed all original filters that point to the original request, to point
instead at the new request in internal_internal_redirect.
And yes, /nothere.txt now reports text/html; charset=ISO8859-1
Bill
Bill
Index: modules/http/http_request.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/http/http_request.c,v
retrieving revision 1.136
diff -u -r1.136 http_request.c
--- modules/http/http_request.c 5 Apr 2002 17:43:03 -0000 1.136
+++ modules/http/http_request.c 5 Apr 2002 19:32:40 -0000
@@ -305,6 +305,7 @@
static request_rec *internal_internal_redirect(const char *new_uri,
request_rec *r) {
int access_status;
+ ap_filter_t *f;
request_rec *new = (request_rec *) apr_pcalloc(r->pool,
sizeof(request_rec));
@@ -369,6 +370,22 @@
new->output_filters = new->proto_output_filters;
new->input_filters = new->proto_input_filters;
+
+ f = new->input_filters;
+ while (f) {
+ if (f->r == r) {
+ f->r = new;
+ }
+ f = f->next;
+ }
+
+ f = new->output_filters;
+ while (f) {
+ if (f->r == r) {
+ f->r = new;
+ }
+ f = f->next;
+ }
ap_add_input_filter("HTTP_IN", NULL, new, new->connection);