I was charged with developing a few Apache modules for various tasks
(timed access, pay-as-you-go access and URI-based authentication for now)
and I kept running into the same problem. Stock Apache 1.1.1 does not
appear to let an arbitrary phase (let's assume one of the authentication
phases) send response data back to the client and terminate the HTTP
transfer without error. As far as I was able to determine, I could return
OK, REDIRECT, DECLINED or an HTTP error code in a phase, but could not
"short-ciruit" at a particular phase or module.
I needed to be able to return content in an arbitrary phase after
determining that a particular module (or phase) should have processed the
request but could not for whatever reason. So I came up with an "escape"
patch to let me do just that.
Basically, the patch lets a module phase return a code (ESCAPE) that says
the request has been handled and that no other phases (or modules) need to
be run. In my case, if my custom authentication handler failed, I would
dynamically mark up an HTML template, return the content to the browser
and terminate the child Apache process by returning ESCAPE.
If Apache modules can already do this, then I would prefer to use the
existing method. If not, I will make the patch available, since I cannot
belive that I'm the only one on the planet who could benefit from this.
Jon Yarden, SysAdmin, Internet Tool & Die
--
The more laws and order are made prominent, the more thieves and
robbers there will be.
-- Lao Tsu