httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Clapper <...@telebase.com>
Subject Patch to mod_cgi
Date Thu, 06 Jun 1996 14:32:59 GMT
I've patched `mod_cgi.c' in a way that may or may not be of general
interest.  But first, a little background.  (Fear not; I'll be brief.)

One of our locally written CGI scripts absolutely needs a non-buffered
connection to the client; since there was no way I could make that
requirement go away, I decided to make the script an NPH script, allowing
it to flush output to the client whenever it wants.  However, for other
reasons (stupid ones I won't go into), the script's name is fixed, and it
doesn't begin with `nph-'.  Since the script's name doesn't begin with
`nph-', `mod_cgi' fires the script up normally and buffers the output to
the client in 8K (IOBUFSIZE) chunks.

The `nph-' business is kind of crufty anyway, so I hacked up `mod_cgi.c' to
support a more general approach.  My hack introduces a new keyword called
`DirectToClient'; I typically throw it into `srm.conf'.  The keyword uses
this syntax:

        DirectToClient uri [ ... ]

e.g.:

        DirectToClient /cgi-bin/moe.cgi
        DirectToClient /cgi-bin/larry /cgi-bin/curley.pl

The URIs are loaded into an internal list kept in the module's config area.
Whenever `mod_cgi' needs to fire up a CGI script, it scans the list; if the
URI of the script matches any of the ones in the list, the script is fired
up with its stdout pointed at the connection socket--just like the old NPH
stuff works, but without the need for the `nph-' prefix.  Of course, the
traditional `nph-' mechanism also works, since I didn't want to break
anything.

If this feature seems to be of general interest, I'll post the patches.
----
Brian Clapper .............................................. bmc@telebase.com
http://www.netaxs.com/~bmc/ ............. PGP public key available on request
Whatever is not nailed down is mine.  What I can pry loose is not nailed down.
        -- Collis P. Huntingdon

Mime
View raw message