From: Alex Rousskov Date: Thu, 15 Oct 2015 02:52:58 +0000 (-0700) Subject: 1xx response terminates Squid-to-server connection, breaking many PUTs. X-Git-Tag: SQUID_4_0_2~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18b4c80dc3a1eb5647a51009e6fd8109d4a8f6f7;p=thirdparty%2Fsquid.git 1xx response terminates Squid-to-server connection, breaking many PUTs. 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. --- diff --git a/src/http.cc b/src/http.cc index 0396b7ede2..39d486a6cb 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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);