From: Alex Rousskov Date: Fri, 3 Dec 2010 22:59:37 +0000 (-0700) Subject: Polished HttpStateData::persistentConnStatus() code. No functionality changes. X-Git-Tag: take1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=718d84bf9a466fb425f733209cd4d172159ff3bd;p=thirdparty%2Fsquid.git Polished HttpStateData::persistentConnStatus() code. No functionality changes. Moved virginReply() call closer to the first virgin reply use. This will help re-adding "did we parse the header yet" check if we ever need it again. It also saves a couple of CPU cycles for some transactions. --- diff --git a/src/http.cc b/src/http.cc index 4212b313fe..fc2dddb3f9 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1009,9 +1009,6 @@ HttpStateData::ConnectionStatus HttpStateData::persistentConnStatus() const { debugs(11, 3, "persistentConnStatus: FD " << fd << " eof=" << eof); - const HttpReply *vrep = virginReply(); - debugs(11, 5, "persistentConnStatus: content_length=" << vrep->content_length); - if (eof) // already reached EOF return COMPLETE_NONPERSISTENT_MSG; @@ -1023,6 +1020,9 @@ HttpStateData::persistentConnStatus() const if (lastChunk && flags.chunked) return statusIfComplete(); + const HttpReply *vrep = virginReply(); + debugs(11, 5, "persistentConnStatus: content_length=" << vrep->content_length); + const int64_t clen = vrep->bodySize(request->method); debugs(11, 5, "persistentConnStatus: clen=" << clen);