cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP/1.1 and HTTP/1.0

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 1 Sep 2008 10:56:27 -0700

On Fri, Aug 29, 2008 at 04:56:24PM -0700, I wrote:
> I discovered a problem while investigating the test case 1069 failure. It
> seems that libcurl still insists on using HTTP 1.1 features even after
> the server identifies itself as being HTTP 1.0 only. Test cases 1071
> through 1074 test various implications of that. For example, libcurl
> should not attempt chunked transfers to a HTTP 1.0 server.

I've come up with a partial solution to this downgrade problem: it involves
moving the httpversion variable from the SingleRequest struct to the
connectdata struct. This makes some sense since it holds the HTTP version
spoken by the remote server at the other end of the connection. But it
breaks down when the remote server doesn't support keep-alive connections
(likely most 1.0 servers) and the connection is torn down for every request,
thus losing the version number for the next request.

This one is tricky to solve properly. Keeping the remote server version
as part of the session instead of (or in addition to) the connectdata
won't be perfectly accurate since there's no way to know if the next
request is going to go to the same server, especially in the presence
of round-robin DNS, load balancing front-ends or even a redirect to a
completely different server. It's probably a good enough approximation,
though, and I'll try coding up something along those lines unless someone
has a better idea.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-09-01