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: 20:36 on 20 Jan 2005

Dorian Taylor wrote:
> suppose i wanted the same logic as:
> 
>     return Apache::DECLINED unless $r->is_initial_req;
> 
> except that sometimes it may be necessary to serve for a subrequest,
> just not more than once. the construct i tried is:
> 
>     for (my $pr = $r; $pr; $pr = $pr->prev) {
>         if ($pr->notes->get(__PACKAGE__ . '::SEEN')) {
>             $r->log->debug("We've been seen already.");
>             return Apache::DECLINED;
>         }       
>     }
>     $r->notes->set(__PACKAGE__ . '::SEEN', 1);
> 
> but i get no love. what's the preferred way of dealing with this?

instead of looping around try $r->main->notes or $r->prev->notes

HTH

--Geoff

Re: [mp2] reliable methods to prevent handlers from repeating
Geoffrey Young 20:36 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