From: "Greg Ames" <[EMAIL PROTECTED]>
Sent: Thursday, December 13, 2001 1:55 PM


> "William A. Rowe, Jr." wrote:
> 
> > Second, autoindex should be a generator [handler].  mod_dir should _NOT_.  I 
>spelled
> > out the reasons for that on 2001.12.02.  
> 
> OK, peace.  But since we were talking about how to drive handlers more
> efficiently, we need to think about the harder cases.  One of them will
> be how to deal with multiple handlers who will accept the same
> r->handler value.  

:)  We have a number of cases like this.  I'd believe that the simplest way
to handle them is to address the handler first in the translation phase (if
the request maps to a non-filesystem uri) or then in the type checker or fixup
based on the content (which is what the old system did 90% of the time anyways.)

Let's look at the full list of Apache handlers;

default_handler

  The fallback case, assigned in fixups if nobody else gloms onto a filesystem 
  request (where r->finfo.filetype != NULL).  Or it could be the product of
  handler_fn != NULL, and left at that.

file_cache_handler, handle_map_file

  Are identified in the translate_names phase (file found) and could be overridden
  with SetHandler/AddHandler in the type-checker phase.  Not really a generator,
  but these are alternates to the default (plain file) cases.

isapi_handler, cgi_handler, cgid_handler, asis_handler, imap_handler

  These can be claimed in the type-checker phase (SetHandler/AddHandler or
  by-content-type.)  All of these are truly handlers because they do very
  unique things with otherwise plain files.

display_info, status_handler 

  Are identified by the location_walk phase (SetHandler or error condition) 
  and really are generators.

ssl_hook_Handler

  A generator I suspect doesn't need to be, we should be allowed to error out
  earlier.  If this is not possible, it's easily identified very early on.
  [Just an "It's Broke, don't send plain requests on an SSL port!" response.]

autoindex_handler

  Can be claimed in the fixups phase if nobody else claims it, it is really
  a generator.

dir_handler, redirect_handler

  We shouldn't have to get this far, we should be able to return the redirect back
  in the fixups phase, as I've proposed for mod_dir.  This allows us to print some
  pretty href in the autoindex listing that would save us a roundtrip from the
  client, potentially.

proxy_handler

  Which is a real handler, and is easily identified up front, at least by the
  fixups phase even on internal proxy redirection.

action_handler

  A really tricky little beast, no?  If you want one to debate, here it is :)


So there's the recap.  I assert that we can decide exactly which handler aught
to take a request no later than the fixups phase.  Comments?

Bill


Reply via email to