]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Alex Rousskov <rousskov@measurement-factory.com>
authorAmos Jeffries <amosjeffries@squid-cache.org>
Wed, 20 Oct 2010 06:09:27 +0000 (00:09 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Wed, 20 Oct 2010 06:09:27 +0000 (00:09 -0600)
Cleanup: Remove old_rep2 from clientReplyContext::handleIMSReply().

StoreEntry::getReply() returns pointer to HttpReply that belongs to MemObject.
It does not create a new object. Hence, outer old_rep, inner old old_rep, and
inner new old_rep2 in handleIMSReply() are equal.

No changes in Squid behavior are expected.

src/client_side_reply.cc

index 359dd028eb457d5b76da78c66722f14a2591ab0a..522e6faebee4ad5ad1d3ea157715ba5406fe2eb0 100644 (file)
@@ -357,14 +357,11 @@ clientReplyContext::handleIMSReply(StoreIOBuffer result)
     HttpReply *old_rep = (HttpReply *) old_entry->getReply();
 
     // origin replied 304
-    // TODO FIXME: old_rep2 was forcibly unshadowed, used to be old_rep. Are we sure
-    //  that the right semantics were preserved?
     if (status == HTTP_NOT_MODIFIED) {
         http->logType = LOG_TCP_REFRESH_UNMODIFIED;
 
         // update headers on existing entry
-        HttpReply *old_rep2 = (HttpReply *) old_entry->getReply();
-        old_rep2->updateOnNotModified(http->storeEntry()->getReply());
+        old_rep->updateOnNotModified(http->storeEntry()->getReply());
         old_entry->timestampsSet();
 
         // if client sent IMS
@@ -376,7 +373,7 @@ clientReplyContext::handleIMSReply(StoreIOBuffer result)
         } else {
             // send existing entry, it's still valid
             debugs(88, 3, "handleIMSReply: origin replied 304, revalidating existing entry and sending " <<
-                   old_rep2->sline.status << " to client");
+                   old_rep->sline.status << " to client");
             sendClientOldEntry();
         }
     }