perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <gyo...@laserlink.net>
Subject RE: Multiple PostReadRequest handlers
Date Tue, 27 Nov 2001 14:53:06 GMT


> -----Original Message-----
> From: Eric Cholet [mailto:cholet@logilune.com]
> Sent: Tuesday, November 27, 2001 7:53 AM
> To: dev@perl.apache.org
> Subject: Multiple PostReadRequest handlers
> 
> 
> Is it possible to have several PostReadRequest handlers
> run for a request? I have an issue where I define two
> of them but only the second one is being run.
> Maybe this is a matter of the return code of the handlers?
> This is under mod_perl 1.x/apache 1.x
> 

bonjour!

you should.  from http_config.c:
int ap_run_post_read_request(request_rec *r)
{
    return run_method(r, offsets_into_method_ptrs.post_read_request, 1);
}

the '1' in run_method() means that it will keep iterating over the handlers
until they are done.  

compare to:

int ap_translate_name(request_rec *r)
{
    return run_method(r, offsets_into_method_ptrs.translate_handler, 0);
}

I just ran a test with

PerlPostReadRequestHandler 'sub { warn "*** inside one"; return
Apache::Constants::OK} '
PerlPostReadRequestHandler 'sub { warn "*** inside two"; return
Apache::Constants::OK} '

and got

*** inside one at (eval 297) line 1.
*** inside two at (eval 298) line 1.

HTH

--Geoff

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message