]> 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:59:37 +0000 (15:59 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 3 Dec 2010 22:59:37 +0000 (15:59 -0700)
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.

src/http.cc

index 4212b313fe43e737f44a38ebb62109198a854170..fc2dddb3f98f297cd8e04c21cfd9ecc08894ee38 100644 (file)
@@ -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);