]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
HTTP1.1: Advertise 1.1 on replies
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 7 Apr 2010 06:22:41 +0000 (18:22 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 7 Apr 2010 06:22:41 +0000 (18:22 +1200)
src/HttpReply.cc
src/client_side.cc
src/client_side_reply.cc
src/http.cc

index 66fe3ed2a43dc64649caf2ddb7d43905f3b67f3e..105135b716ba0eb3c6cc6d2c203ff4b3e7ee6263 100644 (file)
@@ -185,7 +185,7 @@ HttpReply::make304() const
     /* rv->cache_control */
     /* rv->content_range */
     /* rv->keep_alive */
-    HttpVersion ver(1,0);
+    HttpVersion ver(1,1);
     httpStatusLineSet(&rv->sline, ver, HTTP_NOT_MODIFIED, "");
 
     for (t = 0; ImsEntries[t] != HDR_OTHER; ++t)
@@ -202,7 +202,7 @@ HttpReply::packed304Reply()
     /* Not as efficient as skipping the header duplication,
      * but easier to maintain
      */
-    HttpReply *temp = make304 ();
+    HttpReply *temp = make304();
     MemBuf *rv = temp->pack();
     delete temp;
     return rv;
@@ -213,7 +213,7 @@ HttpReply::setHeaders(http_status status, const char *reason,
                       const char *ctype, int64_t clen, time_t lmt, time_t expiresTime)
 {
     HttpHeader *hdr;
-    HttpVersion ver(1,0);
+    HttpVersion ver(1,1);
     httpStatusLineSet(&sline, ver, status, reason);
     hdr = &header;
     hdr->putStr(HDR_SERVER, visible_appname_string);
@@ -248,7 +248,7 @@ void
 HttpReply::redirect(http_status status, const char *loc)
 {
     HttpHeader *hdr;
-    HttpVersion ver(1,0);
+    HttpVersion ver(1,1);
     httpStatusLineSet(&sline, ver, status, httpStatusString(status));
     hdr = &header;
     hdr->putStr(HDR_SERVER, APP_FULLNAME);
index d866b59e5591c2482d8b682df92a72eb0f3fd7dc..a1075ec3f3b3e5c47445f19cfb3db81b4363f178 100644 (file)
@@ -716,8 +716,8 @@ clientSetKeepaliveFlag(ClientHttpRequest * http)
     debugs(33, 3, "clientSetKeepaliveFlag: method = " <<
            RequestMethodStr(request->method));
 
-    /* We are HTTP/1.0 facing clients still */
-    HttpVersion http_ver(1,0);
+    /* We are HTTP/1.1 facing clients now*/
+    HttpVersion http_ver(1,1);
 
     if (httpMsgIsPersistent(http_ver, req_hdr))
         request->flags.proxy_keepalive = 1;
index a6580eb29e060ba5104111082bde1783007794da..9156fb218afe155164ad17c2b9278c17b4fb1be1 100644 (file)
@@ -1443,8 +1443,8 @@ clientReplyContext::cloneReply()
     reply = HTTPMSGLOCK(rep);
 
     if (reply->sline.protocol == PROTO_HTTP) {
-        /* enforce 1.0 reply version (but only on real HTTP traffic) */
-        reply->sline.version = HttpVersion(1,0);
+        /* RFC 2616 requires us to advertise our 1.1 version (but only on real HTTP traffic) */
+        reply->sline.version = HttpVersion(1,1);
     }
 
     /* do header conversions */
index d093aee47edd73391e5da5c17347488e359ea168..23ae05ce3b5085e5b5a5156efa4842be0444674c 100644 (file)
@@ -689,7 +689,7 @@ HttpStateData::processReplyHeader()
         if (!parsed && error > 0) { // unrecoverable parsing error
             debugs(11, 3, "processReplyHeader: Non-HTTP-compliant header: '" <<  readBuf->content() << "'");
             flags.headers_parsed = 1;
-            newrep->sline.version = HttpVersion(1,0);
+            newrep->sline.version = HttpVersion(1,1);
             newrep->sline.status = error;
             HttpReply *vrep = setVirginReply(newrep);
             entry->replaceHttpReply(vrep);
@@ -714,7 +714,7 @@ HttpStateData::processReplyHeader()
     /* Skip 1xx messages for now. Advertised in Via as an internal 1.0 hop */
     if (newrep->sline.protocol == PROTO_HTTP && newrep->sline.status >= 100 && newrep->sline.status < 200) {
 
-#if WHEN_HTTP11
+#if WHEN_HTTP11_EXPECT_HANDLED
         /* When HTTP/1.1 check if the client is expecting a 1xx reply and maybe pass it on */
         if (orig_request->header.has(HDR_EXPECT)) {
             // TODO: pass to the client anyway?