On: Wed, 31 May 2000 17:04:05 EDT Geoffrey Young wrote:

>hi all...
>
>       I'm not sure if this is related to some of the get/set handler
>strangeness that I have been seeing lately (as I try to do some weird
>stacked handler acrobatics), or if it's the result of some closure thing
>that I really shouldn't be doing...
>
>package Test::Test;
>use Apache::Constants qw( OK );
>use strict;
>sub handler
>{
>    my $r = shift;
>    warn "outside..." . $r->current_callback . $r->uri;
>    $r->push_handlers(PerlCleanupHandler => sub { warn "inside..." .
>$r->current_callback . $r->uri;
>                                                  return OK;});
>    return OK;
>}
>1;
>
>anyway, for / => /index.html translation using mod_dir, this PerlInitHandler
>produces:
>
>outside...PerlInitHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm
>line 9.
>outside...PerlInitHandler/index.html at
>/usr/lib/perl5/site_perl/5.005/Test/Test.pm line 9.
>
>inside...PerlCleanupHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm
>line 10.
>inside...PerlFixupHandler/index.html at
>/usr/lib/perl5/site_perl/5.005/Test/Test.pm line 10.

Hi Geoff,

Isn't this what's expected?  The first time through (for "/") you push code
onto the CleanupHandler stack.

Then there's a subrequest (by mod_dir, although I'm just guessing here) to
check for "/index.html", which causes another code ref to be pushed onto
the CleanupHandler stack.

At the completion of the subrequest, the original request is completed,
having two code refs to evaluate once it reaches the Cleanup "phase", one
for the original "/" and one for the "/index.html".

Or am I totally missing your point :)

--kip

Reply via email to