durusmail: quixote-users: Inconsistency between mod_scgi behavior and published scgi protocol?
Inconsistency between mod_scgi behavior and published scgi protocol?
2008-06-23
Inconsistency between mod_scgi behavior and published scgi protocol?
Inconsistency between mod_scgi behavior and published scgi protocol?
2008-06-23
2008-06-24
Inconsistency between mod_scgi behavior and published scgi protocol?
Al Pacifico
2008-06-23
I've been writing a SCGI server program in C (for use as a web service) and
while testing, I came across the following when fetching the URL '
http://localhost/dynamic': mod_scgi passes a SCGI header with name
QUERY_STRING and an empty value (i.e. name NUL  NUL). The protocol specified
the syntax is name NUL value NUL, but since URL does not contain a query
string, there is no value.

Here is the message transmitted by mod_scgi (null characters are not
printed, so you will have to take my word for their presence):
769:CONTENT_LENGTH0SCGI1SERVER_SOFTWAREApache/2.2.8
(Fedora)SERVER_PROTOCOLHTTP/1.1SERVER_NAMElocalhostSERVER_ADMINroot@localhostSER
VER_ADDR127.0.0.1SERVER_PORT80REMOTE_ADDR127.0.0.1REMOTE_PORT50684REQUEST_METHOD
GETREQUEST_URI/dynamicQUERY_STRINGSCRIPT_NAME/dynamicDOCUMENT_ROOT/var/www/htmlH
TTP_HOSTlocalhostHTTP_USER_AGENTMozilla/5.0
(X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080416
Fedora/2.0.0.14-1.fc8
Firefox/2.0.0.14HTTP_ACCEPTtext/xml,application/xml,application/xhtml+xml,text/h
tml;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5HTTP_ACCEPT_LANGUAGEen-us,en;q=0.5
HTTP_ACCEPT_ENCODINGgzip,deflateHTTP_ACCEPT_CHARSETISO-8859-1,utf-8;q=0.7,*;q=0
.7HTTP_KEEP_ALIVE300HTTP_CONNECTIONkeep-aliveHTTP_CACHE_CONTROLmax-age=0,

The portion 'QUERY_STRINGSCRIPT_NAME' contains two successive null
characters between 'QUERY_STRING' and 'SCRIPT_NAME'.

I wrote my C program strictly according the protocol at
http://python.ca/scgi/protocol.txt.

I wonder if mod_scgi should be modified. I think mod_scgi should omit the
query string header if there is no query string.
Alternatively, it could transmit a pair of single quotes when the query
string is empty. Or, the protocol could specify that the query string is
never empty (seems inappropriate because that is so http specific, and the
scgi protocol is more general). I was envisioning circumstances in which the
data to be processed by the SCGI server could be passed as content, i.e. as
a POST instead of a GET, and I had been trying to make my scgi request
processing library as general as possible.

Comments? Am I way off-base here?

Thanks.
-al
--
Al Pacifico
Seattle, WA
reply