]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
1xx response terminates Squid-to-server connection, breaking many PUTs.
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 15 Oct 2015 02:52:58 +0000 (19:52 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 15 Oct 2015 02:52:58 +0000 (19:52 -0700)
Since trunk revision 13688.1.6 (Use Http1::ResponseParser to process
HTTP server responses), HttpStateData::processReplyHeader() sets
flags.headers_parsed after successfully parsing a 1xx control message.
The rest of the code interprets that flag as "parsed the final response"
and throws a !flags.headers_parsed exception because we have not parsed
the final (non-1xx) response yet. The exception kills virtually any PUT
or similar transaction that triggers an HTTP 100 (Continue) response
from the origin server.

This fix restores the original position of the flags.headers_parsed
update.

src/http.cc

index 0396b7ede28c29323cefe0605bb0b824dd11f2c4..39d486a6cbf75e0aecfe2e89f62a14ba87afd9d2 100644 (file)
@@ -723,11 +723,10 @@ HttpStateData::processReplyHeader()
             }
         }
 
-        flags.headers_parsed = true;
-
         if (!parsedOk) {
             // unrecoverable parsing error
             debugs(11, 3, "Non-HTTP-compliant header:\n---------\n" << inBuf << "\n----------");
+            flags.headers_parsed = true;
             HttpReply *newrep = new HttpReply;
             newrep->sline.set(Http::ProtocolVersion(), hp->messageStatus());
             HttpReply *vrep = setVirginReply(newrep);