httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@opengroup.org>
Subject Re: Thoughts on a 2.0 API
Date Wed, 11 Jun 1997 13:25:08 GMT
 
> > I might be jumping in without fully understanding the discussion (or
> > the syntax), but this is already quite simple with Perl:
> > 
> > #httpd.conf
> > <Perl>
> > #push a handler to step in at the translate stage
> > push @PerlTransHandler, sub {
> >      my $r = shift;
> >      my $host = $r->get_remote_host;
> > 
> >      if($host =~ /^fast.somewhere.com$/) {
> >         if($r->uri =~ /(.*)/) {
> >            $r->filename("/usr/local/wwwdocs/$1");
> >            return OK;
> >         }
> >      }        
> >      return DECLINED;
> > };
> > </Perl>
> 
> Yes, but in this case all the phases still occur. There's no way, as I
> understand it, to influence the order of the phases, or the module execution
> order, even from Perl, right?

Well, it depends.  In the example above, mod_perl influences the order
and execution of the translate phase.  Based on some other condition,
it could also: 

$r->handler("perl-script"); #SetHandler perl-script
$r->push_handlers("PerlHandler", \&subroutine);

This would make the dispatcher hand off the response handler phase to
mod_perl at runtime.  $r->handler could change the response handler to
anything `SetHandler' could.  So, it is possible to have some
influence, but not the full control some people might be looking for.

-Doug

> Cheers,
> 
> Ben.
> 
> -- 
> Ben Laurie                Phone: +44 (181) 994 6435  Email: ben@algroup.co.uk
> Freelance Consultant and  Fax:   +44 (181) 994 6472
> Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
> A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
> London, England.          Apache-SSL author
> 

Mime
View raw message