perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject [mp2] map to storage handler
Date Tue, 08 Jun 2004 18:03:31 GMT
I'm trying to work on the map to storage example. Here is what we have now:

1) From httpd-2.0/CHANGES:

   *) Introduce the map_to_storage hook, which allows modules to bypass
      the directory_walk and file_walk for non-file requests.  TRACE
      shortcut moved to http_protocol.c as APR_HOOK_MIDDLE, and the
      directory_walk/file_walk happen as APR_HOOK_VERY_LAST in core.c.
      [William Rowe]

s/APR_HOOK_VERY_LAST/APR_HOOK_REALLY_LAST/ in that comment.

2) And mod_perl hooks in as:

int modperl_map_to_storage_handler(request_rec *r)
{
     return modperl_callback_per_srv(MP_MAP_TO_STORAGE_HANDLER, r, 
MP_HOOK_RUN_FIRST);
}

3) and there is ap_send_http_trace in http_protocol.c, registered as:
ap_hook_map_to_storage(ap_send_http_trace,NULL,NULL,APR_HOOK_MIDDLE);



So we have a problem here. If one uses PerlMapToStorageHandler to shortcut the 
uri2file translation, and returns OK, TRACE calls will be not handled at all. 
since at the moment mod_perl runs its handler before ap_send_http_trace had a 
chance to run.

Of course one could start their PerlMapToStorageHandler with:

   if ($r->method_number != Apache::M_TRACE) {
       return Apache::DECLINED;
   }

as a workaround, but this sounds ugly. May be registering that hook on the 
mod_perl side as APR_HOOK_LAST is a better idea? But how can we be sure that 
tomorrow Apache won't have some other callback in the middle that we may not 
want to run?

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

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


Mime
View raw message