perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
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]


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, 

3) and there is ap_send_http_trace in http_protocol.c, registered as:

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     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message