Sending HTTP/1.1 in all version details sent to peers and servers.

Passes the basic tests I've thrown at it. If anyone can think of some please do.

Amos
=== modified file 'src/HttpRequest.cc'
--- src/HttpRequest.cc	2010-02-25 23:00:39 +0000
+++ src/HttpRequest.cc	2010-03-05 08:18:24 +0000
@@ -327,8 +327,9 @@
 {
     assert(p);
     /* pack request-line */
-    packerPrintf(p, "%s " SQUIDSTRINGPH " HTTP/1.0\r\n",
-                 RequestMethodStr(method), SQUIDSTRINGPRINT(urlpath));
+    packerPrintf(p, "%s " SQUIDSTRINGPH " HTTP/%d.%d\r\n",
+                 RequestMethodStr(method), SQUIDSTRINGPRINT(urlpath),
+                 http_ver.major, http_ver.minor);
     /* headers */
     header.packInto(p);
     /* trailer */

=== modified file 'src/client_side.cc'
--- src/client_side.cc	2010-03-05 07:10:40 +0000
+++ src/client_side.cc	2010-03-05 07:28:51 +0000
@@ -716,8 +716,8 @@
     debugs(33, 3, "clientSetKeepaliveFlag: method = " <<
            RequestMethodStr(request->method));
 
-    HttpVersion http_ver(1,0);
-    /* we are HTTP/1.0, no matter what the client requests... */
+    /* RFC 2616 says 'upgrade' requests to our HTTP/1.1 regardless of what the client is */
+    HttpVersion http_ver(1,1);
 
     if (httpMsgIsPersistent(http_ver, req_hdr))
         request->flags.proxy_keepalive = 1;

=== modified file 'src/client_side_request.cc'
--- src/client_side_request.cc	2010-02-07 03:38:46 +0000
+++ src/client_side_request.cc	2010-03-05 09:57:15 +0000
@@ -367,8 +367,8 @@
 
     request->my_addr.SetPort(0);
 
-    /* RFC 2616 says 'upgrade' to our 1.0 regardless of what the client is */
-    HttpVersion http_ver(1,0);
+    /* RFC 2616 says 'upgrade' to our HTTP/1.1 regardless of what the client is */
+    HttpVersion http_ver(1,1);
     request->http_ver = http_ver;
 
     http->request = HTTPMSGLOCK(request);

=== modified file 'src/http.cc'
--- src/http.cc	2010-03-05 01:38:57 +0000
+++ src/http.cc	2010-03-05 08:46:24 +0000
@@ -1940,7 +1940,7 @@
                                   http_state_flags stateFlags)
 {
     const int offset = mb->size;
-    HttpVersion httpver(1,0);
+    HttpVersion httpver(1,1);
     mb->Printf("%s %s HTTP/%d.%d\r\n",
                RequestMethodStr(aRequest->method),
                aRequest->urlpath.size() ? aRequest->urlpath.termedBuf() : "/",
@@ -2163,15 +2163,6 @@
     deleteThis("HttpStateData::abortTransaction");
 }
 
-#if DEAD_CODE
-void
-httpBuildVersion(HttpVersion * version, unsigned int major, unsigned int minor)
-{
-    version->major = major;
-    version->minor = minor;
-}
-#endif
-
 HttpRequest *
 HttpStateData::originalRequest()
 {

=== modified file 'src/icmp/net_db.cc'
--- src/icmp/net_db.cc	2010-02-06 06:32:11 +0000
+++ src/icmp/net_db.cc	2010-03-05 07:28:51 +0000
@@ -1321,7 +1321,7 @@
 
     HTTPMSGLOCK(ex->r);
     assert(NULL != ex->r);
-    ex->r->http_ver = HttpVersion(1,0);
+    ex->r->http_ver = HttpVersion(1,1);
     ex->connstate = STATE_HEADER;
     ex->e = storeCreateEntry(uri, uri, request_flags(), METHOD_GET);
     ex->buf_sz = NETDB_REQBUF_SZ;

=== modified file 'src/tunnel.cc'
--- src/tunnel.cc	2009-09-04 11:38:28 +0000
+++ src/tunnel.cc	2010-03-05 08:12:44 +0000
@@ -710,7 +710,7 @@
     flags.proxying = tunnelState->request->flags.proxying;
     MemBuf mb;
     mb.init();
-    mb.Printf("CONNECT %s HTTP/1.0\r\n", tunnelState->url);
+    mb.Printf("CONNECT %s HTTP/1.1\r\n", tunnelState->url);
     HttpStateData::httpBuildRequestHeader(tunnelState->request,
                                           tunnelState->request,
                                           NULL,			/* StoreEntry */

Reply via email to