]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polished HttpStateData::persistentConnStatus() code. No functionality changes.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 3 Dec 2010 22:56:17 +0000 (15:56 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 3 Dec 2010 22:56:17 +0000 (15:56 -0700)
Do not check for flags.headers_parsed. The removed check was:
 - misplaced: connection-related conditions such as eof must be checked first;
 - wasteful: we never call persistentConnStatus() unless we parsed headers.

Moreover, calling persistentConnStatus() before we parse headers would trigger
and assertion because the method uses virginReply() which does not exist until
the headers are parsed.

src/http.cc

index c162f2d878ae7d2bf1dbfa1387e2033d623f8fbc..4212b313fe43e737f44a38ebb62109198a854170 100644 (file)
@@ -1012,12 +1012,6 @@ HttpStateData::persistentConnStatus() const
     const HttpReply *vrep = virginReply();
     debugs(11, 5, "persistentConnStatus: content_length=" << vrep->content_length);
 
-    /* If we haven't seen the end of reply headers, we are not done */
-    debugs(11, 5, "persistentConnStatus: flags.headers_parsed=" << flags.headers_parsed);
-
-    if (!flags.headers_parsed)
-        return INCOMPLETE_MSG;
-
     if (eof) // already reached EOF
         return COMPLETE_NONPERSISTENT_MSG;