You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Brian McQueen <mc...@gmail.com> on 2006/11/10 01:25:30 UTC

header parser returning DECLINED

I have a header parser that is returning DECLINED when the headers
show a problem.  I thought that since the header parser was part of my
module, that a DECLINED from the header parser would be the same as
the entire module declining to handle the request.  It seems that it
is only the headers parser that is declining to handle the request
during the header parser phase, but the module's content generator is
still being activated during the content getneration phase.  So each
phase uses the handlers independently, without regard to the return
status of the previous phases within the same module?

Brian McQueen

Re: header parser returning DECLINED

Posted by Joe Lewis <jo...@joe-lewis.com>.
Brian McQueen wrote:
> I have a header parser that is returning DECLINED when the headers
> show a problem.  I thought that since the header parser was part of my
> module, that a DECLINED from the header parser would be the same as
> the entire module declining to handle the request.  It seems that it
> is only the headers parser that is declining to handle the request
> during the header parser phase, but the module's content generator is
> still being activated during the content getneration phase.  So each
> phase uses the handlers independently, without regard to the return
> status of the previous phases within the same module?
Right.  A module should be able to be just a content generator, a header 
parser, or both.  If the module has registered the hooks, apache will 
send the request for that hook when the time comes.  This is because 
some modules will implement clean up routines even if they don't handle 
anything on the request (such as clearing older cache entries).

If you want the content generation to not work if the parser returned 
declined, it may be easier to add a flag to your per-request 
configuration and set it in the parsing, then just return DECLINED at 
the start of the content generation function if the flag is not set 
appropriately.

Joe