From: Alex Rousskov Date: Fri, 3 Dec 2010 22:56:17 +0000 (-0700) Subject: Polished HttpStateData::persistentConnStatus() code. No functionality changes. X-Git-Tag: take1~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eedbb18737582235f10f6caea91249e5ebdb601e;p=thirdparty%2Fsquid.git Polished HttpStateData::persistentConnStatus() code. No functionality changes. 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. --- diff --git a/src/http.cc b/src/http.cc index c162f2d878..4212b313fe 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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;