Hello,

Unfortunately, I did suspect the same before and called Index.cgi
directly.  By calling it directly, $r->log_error($r->prev()->uri())
still perfectly printed one line in error_log.

It's rather a very strange behaviour that I hope someone could figure it
out.  $r->prev() returns a blessed reference while $r->main() returns
undef.  This violates the logic because if $r->prev() does not return
undef, then $r->main() should returns something too as $r is one of the
subsequent internal redirects when $r->prev() is defined.

The workaround I came up is to test $r->main().  If I have the problem
figured out I'll let the list know.

Yours,

Jindo

-----Original Message-----
From: Geoffrey Young [mailto:[EMAIL PROTECTED]] 
Sent: Monday, September 09, 2002 9:35 PM
To: Jindo
Cc: [EMAIL PROTECTED]
Subject: Re: $r->prev is always defined

Jindo wrote:
> Hello,
> 
> According to docs, $r->prev returns undef unless there is an internal
> redirect.  But to 
> my surprises, $r->prev is always defined, severely breaking down the
> code/flow logic 
> of my scripts.
> 
> Here is what I have in /Index.cgi (My browser defaults to that page)
for
> debugging
> $r->log_error($r->prev()->uri());
> $r->log_error($r->uri());

I'd suspect that it's probably mod_dir (via DirectoryIndex) that's 
causing this (since it calls ap_internal_redirect, which sets $r->prev 
and $r->prev->uri).

I also suspect that if you called /Index.cgi directly, you'd get a 500 
(and $r->prev would be undef so $r->prev->uri would bomb).

HTH

--Geoff

Reply via email to