You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Marco Spinetti <m....@pisa.iol.it> on 2007/08/14 12:44:55 UTC
input filter ap_internal_redirect
I have a doubt about my input filter.
I'm writing an input filter which should filter the requests to my handler.
Only special types of requests should go to my handler.
So I'd like that my input filters, if the incoming request is not ok,
does an internal redirect to a static page, without calling my handler.
I don't understand how to do it in my filter.
Is it ok if in my filter I inser:
if (redirect) {
ap_remove_input_filter(f);
ap_internal_redirect(static_page, f->r);
return APR_SUCCESS;
}
Best regards
Marco
Re: input filter ap_internal_redirect
Posted by Marco Spinetti <m....@pisa.iol.it>.
Maybe I don't read very well input filter documentation.
I thought that if I have a module mod_a which is a input filter and a
mod_b which is a handler, it was possibile that mod_a reads the incoming
request and it decides that mod_b should be called or not.
Is it not possible?
Nick Kew ha scritto:
> On Tue, 14 Aug 2007 12:44:55 +0200
> Marco Spinetti <m....@pisa.iol.it> wrote:
>
>
>> So I'd like that my input filters, if the incoming request is not
>> ok, does an internal redirect to a static page, without calling my
>> handler.
>>
>
> Your input filter gets called when your handler reads input data.
> Which is of course too late not to call your handler.
>
> Whatever you're trying to do wants something other than a filter.
>
>
Re: input filter ap_internal_redirect
Posted by Nick Kew <ni...@webthing.com>.
On Tue, 14 Aug 2007 12:44:55 +0200
Marco Spinetti <m....@pisa.iol.it> wrote:
> So I'd like that my input filters, if the incoming request is not
> ok, does an internal redirect to a static page, without calling my
> handler.
Your input filter gets called when your handler reads input data.
Which is of course too late not to call your handler.
Whatever you're trying to do wants something other than a filter.
--
Nick Kew
Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/