httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@liege.ICS.UCI.EDU>
Subject Re: HTTP/1.1 and colons and things
Date Thu, 20 Jun 1996 04:37:04 GMT
OTOH, reading the code in mod_negotiation.c doesn't give me a warm
fuzzy feeling about its parser.  The get_token function parses much
more than just a token.  Although it works fine with normal HTTP/1.0
input (I think), it is a bit unclear what it will do with anything
illegal.  Like Alexei noted, I think it will just append the garbage
onto the previous token if there is no whitespace separator (if there
is whitespace, I think it will treat the garbage as another type).

Urgle.  What I would do in perl is first split the combined header
field into comma-separated parts (each Accept value), then split
parameters from the main type by splitting on the ";".  This would
still have the HTTP compatibility problem with using ":" as a separator,
but at least then I'd know that the "broken" part was localized to
a single Accept entry.  This doesn't help Alexei's problem, but it
might lead to a warmer fuzzy feeling. ;P  But, it is more efficient
in C to process things one character at a time.

The current code is essentially a state machine without a state label,
primarily so that it can be used for all types of Accept* headers.
We may be better off making explicitly separate

    get_type
    get_lang
    get_encoding
    get_parameter

functions just to make it easier to read (and isolate errors).

Now, if I can just get the rest of these gnu programs installed ....

.....Roy

Mime
View raw message