httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: 1.1b3 and things???
Date Thu, 06 Jun 1996 19:46:30 GMT
On Thu, 6 Jun 1996, Ben Laurie wrote:

> > /httpd/incoming/spath.patch: a patch to add the ServerPath directive
> >   to virtual hosts, and send a 400 error on HTTP/1.1+ requests without
> >   a hostname of some sort.
> This one should probably check whether the sscanf actually scanned anything,
> as in "if(sscanf(...) == 2)"... also, should we be introducing HTTP/1.1 checks
> at this point?

Regarding sscanf(), I don't think checks are neccessary. What the code
looks like is this:

   int major = 1, minor = 0;
   sscanf(r->protocol, "HTTP/%d.%d", &major, &minor);
   r->proto_num = 1000*major + minor;

All the sscanf()s I've used, if they don't match the format string,
just leave the given arguments alone. So major and minor still contain
1 and 0, which gives a default of 1000 for the protocol (since a 0.9
response will always have "HTTP/0.9" in r->protocol). I don't think
there's a situation where you'll end up with the wrong thing (or
worse, bad things) in the major or minor variables.

As for whether or not we should be putting HTTP/1.1 things, as I said,
I think it's important that we do this one now, because who knows how
long it will be until Apache 1.2 (or 2.0 even) will be released, and
the error response is really for when browser manufacturers begin to
implement HTTP/1.1 in their browsers.


Alexei Kosut <>      The Apache HTTP Server
      "War does not determine who is right, only who is left."

View raw message