You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by titetluc titetluc <ti...@gmail.com> on 2008/09/18 16:31:28 UTC

[MP2]: strange behavior with Apache2::SubRequest::run

Hello all,

I have 2 URIs returning HTTP_MOVED_TEMPORARILY
The first one, /test_mod_perl is written using mod_perl
The second one, /test_mod_cgi is written using CGI

I call each of these URIs using a Apache2::SubRequest object

my $subr1 = $r->lookup_uri('/test_mod_perl');
my $rc1 = $subr1->run();             ==========> $rc1 = 302
my $status1 = $subr1->status();  ==========> $status1 = 200

my $subr2 = $r->lookup_uri('/test_mod_cgi');
my $rc2 = $subr2->run();             ==========> $rc1 = 0
my $status2 = $subr2->status();  ==========> $status1 = 302

Why this behavior ? Why are there differences between the 2 URIs ?
IMHO, the second behavior is the correct one.

What is your opinion ???

Thanks

Re: [MP2]: strange behavior with Apache2::SubRequest::run

Posted by titetluc titetluc <ti...@gmail.com>.
Does anyone has additional documentation on Apache2::SubRequest::run and
Apache2::SubRequest::status returned values ?

Gaetan

2008/9/22 titetluc titetluc <ti...@gmail.com>

> 2008/9/19 Torsten Foertsch <to...@gmx.net>
>
>> On Fri 19 Sep 2008, titetluc titetluc wrote:
>> > > Does your mod_perl one return Apache2::Const::REDIRECT at the end?
>> >
>> > No, the module returns Apache2::Const::MOVED_TEMPORARILY, setting the
>> > Location header by using $r->err_headers_out
>>
>> $ perl -MApache2::Const=REDIRECT,HTTP_MOVED_TEMPORARILY -le 'print
>> REDIRECT; print HTTP_MOVED_TEMPORARILY'
>> 302
>> 302
>>
>> Guess what that means.
>
>
> That means REDIRECT and HTTP_MOVED_TEMPORARILY are synonyms, but that does
> not explain the Apache2::SubRequest::run and $subr->status returned values
> !!!! ;-)
>
>
>>
>> Torsten
>>
>> --
>> Need professional mod_perl support?
>> Just hire me: torsten.foertsch@gmx.net
>>
>
>

Re: [MP2]: strange behavior with Apache2::SubRequest::run

Posted by titetluc titetluc <ti...@gmail.com>.
2008/9/19 Torsten Foertsch <to...@gmx.net>

> On Fri 19 Sep 2008, titetluc titetluc wrote:
> > > Does your mod_perl one return Apache2::Const::REDIRECT at the end?
> >
> > No, the module returns Apache2::Const::MOVED_TEMPORARILY, setting the
> > Location header by using $r->err_headers_out
>
> $ perl -MApache2::Const=REDIRECT,HTTP_MOVED_TEMPORARILY -le 'print
> REDIRECT; print HTTP_MOVED_TEMPORARILY'
> 302
> 302
>
> Guess what that means.


That means REDIRECT and HTTP_MOVED_TEMPORARILY are synonyms, but that does
not explain the Apache2::SubRequest::run and $subr->status returned values
!!!! ;-)


>
> Torsten
>
> --
> Need professional mod_perl support?
> Just hire me: torsten.foertsch@gmx.net
>

Re: [MP2]: strange behavior with Apache2::SubRequest::run

Posted by Torsten Foertsch <to...@gmx.net>.
On Fri 19 Sep 2008, titetluc titetluc wrote:
> > Does your mod_perl one return Apache2::Const::REDIRECT at the end?
>
> No, the module returns Apache2::Const::MOVED_TEMPORARILY, setting the
> Location header by using $r->err_headers_out

$ perl -MApache2::Const=REDIRECT,HTTP_MOVED_TEMPORARILY -le 'print 
REDIRECT; print HTTP_MOVED_TEMPORARILY'
302
302

Guess what that means.

Torsten

--
Need professional mod_perl support?
Just hire me: torsten.foertsch@gmx.net

Re: [MP2]: strange behavior with Apache2::SubRequest::run

Posted by titetluc titetluc <ti...@gmail.com>.
2008/9/18 Perrin Harkins <pe...@elem.com>

> On Thu, Sep 18, 2008 at 10:31 AM, titetluc titetluc <ti...@gmail.com>
> wrote:
> > I have 2 URIs returning HTTP_MOVED_TEMPORARILY
> > The first one, /test_mod_perl is written using mod_perl
> > The second one, /test_mod_cgi is written using CGI
>
> Does your mod_perl one return Apache2::Const::REDIRECT at the end?
>


No, the module returns Apache2::Const::MOVED_TEMPORARILY, setting the
Location header by using $r->err_headers_out


> - Perrin

Re: [MP2]: strange behavior with Apache2::SubRequest::run

Posted by Perrin Harkins <pe...@elem.com>.
On Thu, Sep 18, 2008 at 10:31 AM, titetluc titetluc <ti...@gmail.com> wrote:
> I have 2 URIs returning HTTP_MOVED_TEMPORARILY
> The first one, /test_mod_perl is written using mod_perl
> The second one, /test_mod_cgi is written using CGI

Does your mod_perl one return Apache2::Const::REDIRECT at the end?

- Perrin