Re: [mp2] reliable methods to prevent handlers from repeating

[prev] [thread] [next] [Date index for 2005/01/20]

From: Geoffrey Young
Subject: Re: [mp2] reliable methods to prevent handlers from repeating
Date: 23:54 on 20 Jan 2005

> what about unregistering the handler from the stack? is that possible?

yes, but only if the phase you want to unregister isn't the same as the
current phase

 # works, except during a PerlAuthenHandler
 $r->set_handlers(PerlAuthenHandler => []);

> just to clarify: what *are* $r->next/prev if not a way to access
> the requests that have happened since the main, or is it only those
> which have happened via internal_redirect? are the subrequests
> generated by lookup_uri exempt from the list?

$r->is_initial_req() should return true only for the request that came from
the browser.

$r->is_main() should return true for the first in a series of (sub)requests,
subrequests or otherwise.  so, it returns true for the request that came
from the browser, as well as any initiated from internal_redirect()

$r->main returns the first $r in a series of (sub)requests, both those
generated from internal_redirect as well as the initial request from the
browser.

> if you had to deal with this scenario, what would you do?

probably the globals trick I mentioned :)

HTH

--Geoff

Re: [mp2] reliable methods to prevent handlers from repeating
Geoffrey Young 23:54 on 20 Jan 2005

Re: [mp2] reliable methods to prevent handlers from repeating
Philippe M. Chiasson 22:32 on 20 Jan 2005

Generated at 17:42 on 27 Jan 2005 by mariachi v0.52