]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Henrik Nordstrom <hno@squid-cache.org>
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 6 Mar 2010 06:13:30 +0000 (19:13 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 6 Mar 2010 06:13:30 +0000 (19:13 +1300)
Swallow 1xx status messages

Ported from 2.7. This makes Squid swallow 1xx replies from 1.1 servers
safely without breaking the clients connection.

src/http.cc

index 5578f1777bbbe5b4dbf2c30d2c68816a13123da6..278786c22491857406e583be55266140e7f9314d 100644 (file)
@@ -748,6 +748,19 @@ HttpStateData::processReplyHeader()
         readBuf->consume(header_bytes_read);
     }
 
+    /* Skip 1xx messages for now. Advertised in Via as an internal 1.0 hop */
+    if (newrep->sline.status >= 100 && newrep->sline.status < 200) {
+        delete newrep;
+        debugs(11, 2, HERE << "1xx headers consume " << header_bytes_read << " bytes header.");
+        header_bytes_read = 0;
+        if (reply_bytes_read > 0)
+            debugs(11, 2, HERE << "1xx headers consume " << reply_bytes_read << " bytes reply.");
+        reply_bytes_read = 0;
+        ctx_exit(ctx);
+        processReplyHeader();
+        return;
+    }
+
     flags.chunked = 0;
     if (newrep->header.hasListMember(HDR_TRANSFER_ENCODING, "chunked", ',')) {
         flags.chunked = 1;