perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Cholet <cho...@logilune.com>
Subject RE: Multiple PostReadRequest handlers
Date Tue, 27 Nov 2001 14:56:07 GMT
--On mardi 27 novembre 2001 09:53 -0500 Geoffrey Young 
<gyoung@laserlink.net> wrote:

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

Ah, I know what's going on. I have one handler defined at the top level
(outside any container) and one defined in that particular <virtualhost>.
>From what I read in mod_perl source, at merge time the latter replaces
the former. So I guess I should either declare them both at the same level,
either outside of any container, or inside any container where I need both.

> bonjour!

Merci !

--
Eric Cholet


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


Mime
View raw message