On Thu, 14 Sep 2000, brian d foy wrote:
 
> okay - i got that to work.  i was getting confused because notes from the
> handler() were showing up in the current request's notes for the
> custom_response() handler *and* (as i've discovered) in the previous
> notes.  should that happen? 

it shouldn't, i don't see that happening with this test:

sub MyThrow::handler {
    my $r = shift;

    $r->notes("Throw" => "whoopsie");
    $r->custom_response(500, "/catch");

    500;
}

sub MyCatch::handler {
    my $r = shift;

    $r->send_http_header;

    print "notes:\n";
    $r->notes->do(sub { print "   @_\n"; 1 });

    print "prev->notes:\n";
    $r->prev->notes->do(sub { print "   @_\n"; 1 });

    0;
}

<Location /throw>
SetHandler perl-script
PerlHandler MyThrow::handler
</Location>
<Location /catch>
SetHandler perl-script
PerlHandler MyCatch::handler
</Location>

% telnet localhost 8529
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
GET /throw http/1.0

HTTP/1.1 500 Internal Server Error
Date: Thu, 28 Sep 2000 18:08:31 GMT
Server: Apache/1.3.13-dev (Unix) mod_perl/1.24_01-dev Perl/v5.7.0
Connection: close
Content-Type: text/plain

notes:
   PERL_CUR_HOOK PerlHandler
   setenvif-phase-flag post-read done
prev->notes:
   PERL_CUR_HOOK PerlHandler
   setenvif-phase-flag post-read done
   Throw whoopsie
Connection closed by foreign host.


Reply via email to