httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sumeet Singh <>
Subject Re: [apache-modules] Re: Internal redirect from an output filter (Apache2.x)
Date Fri, 09 Apr 2004 00:29:41 GMT
André Malo wrote:

>* Sumeet Singh <> wrote:
>[internal redirects in output filters]
>>Yes, I also find it unsafe. However, note that some standard modules do 
>>that too. For example mod_include runs sub-requests from within its 
>>output filters. In my opinion this shouldn't be allowed, because with 
>>the wrong configuration a web-admin could cause the server to go into 
>>recursion. But since mod_include is a standard module, I guess what it 
>>does is considered legal.
>Subrequests and internal redirects are entirely different things. A subrequest
>can be done from almost everywhere and affects just the data flow (if at all).
>An internal redirect affects the current _control flow_.
I understand how a sub-request is different from an internal-redirect. 
However, my point was that of recursion. If you have any light to shed 
on the original question I asked (that whether it is legal to invoke 
ap_internal_redirect from an output filter) I would really appreciate that.

And by the way, I don't agree that sub-requests are *entirely different* 
from internal-redirects. For example if you did a subrequest-uri-lookup 
followed by a ap_run_sub_req you would still end-up running all the 
stages (except post-read-request) and generating data and sending it 
down the output filter stack. Same thing is done by internal-redirect. 
There are subtle differences like the state of r->main/r->next/r->prev, 
filters inherited by the new request, running or not running of 
post_read_request and quick-handler stages, but finally both are 
recursions. And both the above generate data going down the output 
filter stack. After calling ap_internal_redirect you are supposed return 
immediately with a OK/DONE, but what if you didn't - then you would 
essentially be doing what people do with subrequests.

If you wish to continue this discussion, please start a separate thread.

View raw message