]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix first-line debug display after dropping parsedCount_
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 20 May 2014 11:07:44 +0000 (04:07 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 20 May 2014 11:07:44 +0000 (04:07 -0700)
src/http/one/RequestParser.cc

index 8147a60abf4b50006ed2cea54cdbe37cb49913f0..e446a16c603181e033d186a5706b30dd9a7a0262 100644 (file)
@@ -339,8 +339,15 @@ Http::One::RequestParser::parse(const SBuf &aBuf)
     if (parsingStage_ == HTTP_PARSE_FIRST) {
         PROF_start(HttpParserParseReqLine);
         const int retcode = parseRequestFirstLine();
+
+        // first-line (or a look-alike) found successfully.
+        if (retcode > 0) {
+            buf.consume(firstLineSize()); // first line bytes including CRLF terminator are now done.
+            parsingStage_ = HTTP_PARSE_MIME;
+        }
+
         debugs(74, 5, "request-line: retval " << retcode << ": from " << req.start << "->" << req.end <<
-               " line={" << buf.length() << ", data='" << buf << "'}");
+               " line={" << aBuf.length() << ", data='" << aBuf << "'}");
         debugs(74, 5, "request-line: method " << req.m_start << "->" << req.m_end << " (" << method_ << ")");
         debugs(74, 5, "request-line: url " << req.u_start << "->" << req.u_end << " (" << uri_ << ")");
         debugs(74, 5, "request-line: proto " << req.v_start << "->" << req.v_end << " (" << msgProtocol_ << ")");
@@ -352,12 +359,6 @@ Http::One::RequestParser::parse(const SBuf &aBuf)
             parsingStage_ = HTTP_PARSE_DONE;
             return false;
         }
-
-        // first-line (or a look-alike) found successfully.
-        if (retcode > 0) {
-            buf.consume(firstLineSize()); // first line bytes including CRLF terminator are now done.
-            parsingStage_ = HTTP_PARSE_MIME;
-        }
     }
 
     // stage 3: locate the mime header block