httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: Kill a request nicely
Date Tue, 14 Jun 2011 22:12:29 GMT
On Tue, 14 Jun 2011 16:31:22 -0500
Jason Funk <> wrote:

> I am writing an output filter module that will under some circumstances want
> to send back an HTTP Error Code and kill the request without sending back
> the content.

You can't set an HTTP response code when one has already been sent
down the wire to the client.  It's in the nature of an output
filter that the work is done in a callback, which (in general)
only happens after the response has started, and too late to
set a response code or headers.  Thus the filter callback API
isn't designed to set a status like a processing hook can
when it determines the outcome of a request.

The only way you can affect a response status is to return an 
error to your caller before passing anything down the chain.

Nick Kew

Available for work, contract or permanent.

View raw message