From: Alex Rousskov Date: Fri, 19 Feb 2016 21:26:00 +0000 (-0700) Subject: Fix propagation of response status line parsing error details. X-Git-Tag: SQUID_4_0_7~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ada1f18c8fd757447093fe936aa111eae9063a02;p=thirdparty%2Fsquid.git Fix propagation of response status line parsing error details. This is a follow-up patch to trunk r14548 (Bug 4432). Now that the calling code is using the right field to get the parsing error details (parseStatusCode), we need to fix the code that sets those parsing error details [in case of response status line parsing errors]. TODO: To minimize chances of similar "I forgot to set parseStatusCode" bugs slipping through, hide that data member behind a method that returns scInvalidHeader (or a new scInternalSquidError) if parseError_ is still zero. Rename parseStatusCode to parseError_ and stop confusing it with the response status code. --- diff --git a/src/http/one/ResponseParser.cc b/src/http/one/ResponseParser.cc index 8414063a3c..1cf7613de2 100644 --- a/src/http/one/ResponseParser.cc +++ b/src/http/one/ResponseParser.cc @@ -231,7 +231,7 @@ Http::One::ResponseParser::parse(const SBuf &aBuf) // syntax errors already if (retcode < 0) { parsingStage_ = HTTP_PARSE_DONE; - statusCode_ = Http::scInvalidHeader; + parseStatusCode = Http::scInvalidHeader; return false; } }