httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <>
Subject Re: bug/feature request
Date Tue, 18 Feb 1997 17:20:23 GMT
On Tue, 18 Feb 1997, Roy T. Fielding wrote:

> Rob Hartill writes:
> >I have a need to allow a handler (HeaderParser in this case) to
> >return a response code that indicates "All done - nothing else to do".
> >
> >It'd be wonderfully useful if "die" could do *nothing* based on a specific
> >response code, say DONE=-2
> >
> >At the moment I've got a handler that sends a full response to the
> >client and then returns to Apache to call "die" which then insists on
> >tagging on another set of headers and an explanation of what went *wrong*.
> >For me, that's a bug that I can't work around.
> No, it's a feature request, just like any other concept that wasn't
> designed into pre-beta 1.2.
> If the module "handles the request", what is the state of the connection?
> How does the server decide whether or not keep-alives are enabled?

That's left to Apache core routines. The problem is that if the handler
returns after outputing its response then Apache still wants to look
for r->filename and return that too. If I make r->filename = /dev/null
then that helps with 'not found' problems but Apache still wants to send
another set of HTTP headers and it's processing a lot of code that only
serves to waste CPU cycles.

> Why does the module need to handle the entire request,

it's not so much handling the entire request, just that Apache can't
(AFAIK) be told "we've finished early", at least not from the HeaderParser
handler hook.

The HeaderParser handler is an ideal place to get a fast turnaround on
requests that don't need to go through tons of other Apache code first.
The handler I have (in Perl) does it's own access checks to boot off
the badbots before processing the request and sending the response (via
API calls).

> instead of just
> working like all the other Apache modules?  Have you considered using
> tag-team modules (passing state between handler invocations) to achieve
> the same thing?

With mod_perl I can (and do) just call one handler from another. This
eliminates lots of internal redirects and the location/directory walk table
searches needed to perform the redirect . I just can't convince Apache not
to continue the request when the response has nothing left to do.

It's unconventional, but it's bloody fast :-)


View raw message