httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Moss" <>
Subject [users@httpd] Re: Apache::Request question
Date Tue, 08 Apr 2003 18:00:03 GMT

you are an absolute star!!!!
I am indeed suffering from a sub_req. And $r->main did indeed help me get
back to my Object.

I've been stressing over this for weeks, I may actually get a decent nights
sleep tonight!

Thank you


----- Original Message -----
From: "Vince Veselosky" <>
To: "Martin Moss" <>
Cc: <>; <>
Sent: Tuesday, April 08, 2003 3:50 PM
Subject: Re: Apache::Request question

> I had a similar experience recently when one of my handlers was getting
> executed twice for each request, with different request objects each
> time. It turned out that something (in my case mod_dir) was generating a
> subrequest (at the fixup stage), which creates a new Apache object.  I
> suspect that the unexpected subrequest is also biting you.
> Perhaps you can test using $r->is_main to see if the request is or is
> not a subrequest. If it is, you can use $r->prev or $r->main to get at
> the originating request, if that is what you need. (It's a shame that
> $r->main returns undef instead of a reference to itself in the main
> request, it would be useful to always be able to get ahold of the main
> request that way instead of all the testing.)
> Hope that helps you!
> -Vince Veselosky
> Martin Moss wrote:
> >All,
> >
> >
> >During one complete cycle of a Request, e.g.
> >authen handler -> authz handler -> method handler
> >
> >should/does Apache give the same 'Apache' Object to my code.
> >e.g. If I dump the Apache object at the start of each 'handler' should I
> >expect to see the following identical line?:-
> >$VAR1 = bless( do{\(my $o = 145577148)}, 'Apache' );
> >
> ><incidentally can anybody tell me what the $o refers to?>
> >
> >The reason I ask is, that I don't see this behaviour. The first two
> >(authen and authz) have the same one, but I get a new Apache Object for
> >method handler.
> >This is causing me grief because it means that when I do an
> >Apache::request->instance($r) I get a NEW Apache::Request object not  the
> >same INSTANCE I was getting for the first two phases, and indeed
> >to get for each phase of the request cycle (I editted the
> >Apache::Request->instance subroutine to print a warning whenever it can't
> >find the previous object in the pnotes, and it is definitely creating a
> >object).
> >Also, The Apache::Request Object that is created based upon the new
> >Object doesn't go out of scope until I stop apache. Which doesnt' seem
> >right.
> >
> >I am not calling the child_terminate anywhere and so I am confused as to
> >whether this is standard behaviour or not.
> >
> >Can anybody throw me a light on this one?
> >
> >Marty
> >
> >
> >
> >
> >

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message