Thanks for the feedback. At least I am not wacko. Further comments
below.

On 18/02/2006, at 5:44 PM, Deron Meranda wrote:

I guess the positive thing is that because of this I don't have
any existing code which actually uses multiple mod_python
handlers in the same phase; so this change in behavior is
only positive for me.  So for me it's +1 on Graham's suggested
change in logic (but any incompatible change in behavior is
something to think hard about).

As for an example where this could even be benificial to the
content phase, consider having different content handlers, one
which outputs application/xhtml+xml+SVG+MathML and one
for text/html+GIF.  Then the first handler would look at the
Accept header, etc, and if the user-agent can't support it,
it returns a defer and then the text/html handler gets a chance.

However, I still think even this new proposal is somewhat restrictive.
For example there's no way to interleave C and python handlers
in the list-to-try (this is because to apache all the mod_python
handlers look just like one handler).  Of course a necessary thing
to go along with this, would be a way to specify the hook order (one
of APR_HOOK_REALLY_FIRST, _FIRST, _MIDDLE,
_LAST, or _REALLY_LAST).

Perhaps mod_python can actually add multiple hooks to itself
in for each phase (at each order position), and then have a way
for the python-handlers to optionally specify a position.  If
mod_python had no handlers for a particilar hook position it
would just by default return a decline.

Yeah, have thought in the past about how mod_python could be made
to register handlers as really first, first, last and really last. Besides how
one would denote that in the configuration file, was concerned about
the overhead that might result. This is because mod_python would
need to register a permanent hook against every one of them and thus
no matter what the request is for, you get multiple calls into mod_python for each phase just so it can check its configuration to see if it has to do anything or not. Even if it decides not to do anything, it is an overhead
on every request made to the server as far as I understand it.

In respect of interleaving and ordering of handlers within a phase,
am not sure that Apache provides much guarantees about order
within a section such as middle etc. Therefore the only way to ensure
that a handler is run in the right situation is not to have its condition
check for running overlap with any other handler in that section.

Graham

Reply via email to