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

This is a discussion on [MP2]: strange behavior with Apache2::SubRequest::run - modperl ; 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 ...

+ Reply to Thread
Results 1 to 5 of 5

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

  1. [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


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

    On Thu, Sep 18, 2008 at 10:31 AM, titetluc titetluc 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


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

    2008/9/18 Perrin Harkins

    > On Thu, Sep 18, 2008 at 10:31 AM, titetluc titetluc
    > 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



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

    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


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

    2008/9/19 Torsten Foertsch

    > 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
    >



+ Reply to Thread