]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix propagation of response status line parsing error details.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 19 Feb 2016 21:26:00 +0000 (14:26 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 19 Feb 2016 21:26:00 +0000 (14:26 -0700)
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.

src/http/one/ResponseParser.cc

index 8414063a3c9361795b48c72883e8499e26bafd11..1cf7613de22beddf391a8e247594cb9e78448e37 100644 (file)
@@ -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;
         }
     }