I haven't followed this whole thread, so I may be way off base here:

If you're implementing a filter, you're filter handlers _will_ be called as many times as neccessary.

You can account for multiple invocations or pass along information in

$f->ctx()  see the filter examples on the docs site.

$f is an Apache2::Filter subclass....


------------------------------------------------------------------------
"Love is not the one you can picture yourself marrying,
but the one you can't picture the rest of your life without."

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com


On Tue, 13 Dec 2005, Josh Narins wrote:

From: Jeremy Nixon <[EMAIL PROTECTED]>
Josh Narins <[EMAIL PROTECTED]> wrote:

>> Is it breaking anything?
>
> A fixup handler that says "if the url matches /baz/" then do a little work > here. That work ends up getting done twice (including, in just one instance,
> saving something to the DB, where I get double entries). For instance,
> /object/staff and /otherobject/staff both trigger the same fixup handler,
> because $r->uri =~ m#/staff#, regardless of /object or /otherobject at the
> beginning.
>
> Maybe it wasn't the soundest design principle in the first place, but, hey,
> I wasn't expecting _this_.

I think in general your handlers should be prepared to be called on
subrequests.  If one extra request is a problem, just imagine the hilarity
that will ensue when you get a directory request with indexes enabled.

Sounds like more than a laugh a minute.

You can, for example, check $r->is_initial_req and do your thing if so.

Any advice on tracking this down?

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

Reply via email to