You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Andrew <su...@gmail.com> on 2012/07/12 01:51:44 UTC

[users@httpd] Request mixup with internal redirects

Hi All,

I'm seeing some unusual behavior with my module when using internal
redirects. When I redirect, e.g.

ap_internal_redirect(url, r);
return OK;

I noticed the original request continues to process (going through all
the handlers), although the redirect request is returned to the
browser. So, first question is why does the original request continue
to process and is there a way to halt it?

Now the real problem is, on occasion, the next request returns the
original request from the previous request.

To clarify, here's an example

Request 1: /x/y internal redirects to x/y/z (the original request
fails, but x/y/z is return to the browser)
Request 2: /a returns the response from the /x/y request

BTW, all requests are handled by mod_proxy. What's interesting is the
failed response (ErrorDocument) does not contain any headers, just the
body. The second request doesn't hit any handlers and doesn't even
show up in the access log for the vhost. Basically, with logging set
to debug, there's no indication of it being processed by Apache,
except that it returns an Apache error. I can change the error
returned after the redirect and every time I see that is what is
returned by the second request.

Andrew

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Request mixup with internal redirects

Posted by Andrew <su...@gmail.com>.
That fixes it! Thanks!!

I'm using ap_hook_post_read_request and sandwiching it between
modsetenvif and another custom module with APR_HOOK_FIRST

On Wed, Jul 11, 2012 at 6:07 PM, Nick Kew <ni...@webthing.com> wrote:
>
> On 12 Jul 2012, at 00:51, Andrew wrote:
>
>> Hi All,
>>
>> I'm seeing some unusual behavior with my module when using internal
>> redirects. When I redirect, e.g.
>>
>> ap_internal_redirect(url, r);
>> return OK;
>
> Are you doing that from somewhere early in the request processing cycle?
>
> What happens if you return DONE in place of OK?
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Request mixup with internal redirects

Posted by Nick Kew <ni...@webthing.com>.
On 12 Jul 2012, at 00:51, Andrew wrote:

> Hi All,
> 
> I'm seeing some unusual behavior with my module when using internal
> redirects. When I redirect, e.g.
> 
> ap_internal_redirect(url, r);
> return OK;

Are you doing that from somewhere early in the request processing cycle?

What happens if you return DONE in place of OK?

-- 
Nick Kew

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org