]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed some variable shadowing.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 25 Nov 2009 17:10:52 +0000 (18:10 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 25 Nov 2009 17:10:52 +0000 (18:10 +0100)
src/cbdata.cc
src/client_side_reply.cc
src/forward.cc

index 5675a787f94065f6120acf9824d2a097dc3be1bc..ab5ee3a6e80a6dd26921aa68c85a84f704b890a2 100644 (file)
@@ -111,11 +111,11 @@ public:
     cbdata_type type;
 #if CBDATA_DEBUG
 
-    void addHistory(char const *label, char const *file, int line) {
+    void addHistory(char const *label, char const *aFile, int aLine) {
         if (calls.size() > 1000)
             return;
 
-        calls.push_back(new CBDataCall(label, file, line));
+        calls.push_back(new CBDataCall(label, aFile, aLine));
     }
 
     dlink_node link;
@@ -126,7 +126,7 @@ public:
 
     /* cookie used while debugging */
     long cookie;
-    void check(int line) const {assert(cookie == ((long)this ^ Cookie));}
+    void check(int aLine) const {assert(cookie == ((long)this ^ Cookie));}
     static const long Cookie;
 
 #if !HASHED_CBDATA
index 3ae6af5b934e80e060d8fd2f2c5f6a2133539cb4..8d37cb327d60731a72d36da651c28c5d1e166fcf 100644 (file)
@@ -357,13 +357,14 @@ 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_rep = (HttpReply *) old_entry->getReply();
-        old_rep->updateOnNotModified(http->storeEntry()->getReply());
+        HttpReply *old_rep2 = (HttpReply *) old_entry->getReply();
+        old_rep2->updateOnNotModified(http->storeEntry()->getReply());
         old_entry->timestampsSet();
 
         // if client sent IMS
@@ -375,7 +376,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_rep->sline.status << " to client");
+                   old_rep2->sline.status << " to client");
             sendClientOldEntry();
         }
     }
index bc3a4e58c8130b989c52a8e231ea127d8ea3ecbd..009bc193ab0fa66a9bc3641d387632055791f19b 100644 (file)
@@ -993,9 +993,9 @@ FwdState::dispatch()
                  * prepared in the kernel by the ZPH incoming TCP TOS preserving
                  * patch.
                  */
-                unsigned char * p = buf;
-                while (p-buf < len) {
-                    struct cmsghdr *o = (struct cmsghdr*)p;
+                unsigned char * pbuf = buf;
+                while (pbuf-buf < len) {
+                    struct cmsghdr *o = (struct cmsghdr*)pbuf;
                     if (o->cmsg_len<=0)
                         break;
 
@@ -1003,7 +1003,7 @@ FwdState::dispatch()
                         clientFde->upstreamTOS = (unsigned char)(*(int*)CMSG_DATA(o));
                         break;
                     }
-                    p += CMSG_LEN(o->cmsg_len);
+                    pbuf += CMSG_LEN(o->cmsg_len);
                 }
             } else {
                 debugs(33, 1, "ZPH: error in getsockopt(IP_PKTOPTIONS) on FD "<<server_fd<<" "<<xstrerror());