This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new db3b5a1  HostDB: Fix cache data version checking to use full version, 
not major version. (#7263)
db3b5a1 is described below

commit db3b5a19f67f0e63150867886c6bc0779be406ed
Author: Alan M. Carroll <a...@apache.org>
AuthorDate: Fri Oct 9 14:02:41 2020 -0500

    HostDB: Fix cache data version checking to use full version, not major 
version. (#7263)
    
    (cherry picked from commit 439e317d5d91d3732fc23f70f3137ab2f727bfbe)
---
 iocore/hostdb/P_RefCountCache.h | 4 ++--
 iocore/hostdb/RefCountCache.cc  | 9 ++++-----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/iocore/hostdb/P_RefCountCache.h b/iocore/hostdb/P_RefCountCache.h
index 9807382..9cbedb4 100644
--- a/iocore/hostdb/P_RefCountCache.h
+++ b/iocore/hostdb/P_RefCountCache.h
@@ -373,8 +373,8 @@ public:
   ts::VersionNumber object_version; // version passed in of whatever it is we 
are caching
 
   RefCountCacheHeader(ts::VersionNumber object_version = ts::VersionNumber());
-  bool operator==(const RefCountCacheHeader other) const;
-  bool compatible(RefCountCacheHeader *other) const;
+  bool operator==(RefCountCacheHeader const &that) const;
+  bool compatible(RefCountCacheHeader *that) const;
 };
 
 // RefCountCache is a ref-counted key->value map to store classes that inherit 
from RefCountObj.
diff --git a/iocore/hostdb/RefCountCache.cc b/iocore/hostdb/RefCountCache.cc
index b7cecae..af9cf0f 100644
--- a/iocore/hostdb/RefCountCache.cc
+++ b/iocore/hostdb/RefCountCache.cc
@@ -41,14 +41,13 @@ RefCountCacheHashEntry::dealloc(RefCountCacheHashEntry *e)
 RefCountCacheHeader::RefCountCacheHeader(ts::VersionNumber object_version) : 
object_version(object_version){};
 
 bool
-RefCountCacheHeader::operator==(const RefCountCacheHeader other) const
+RefCountCacheHeader::operator==(RefCountCacheHeader const &that) const
 {
-  return this->magic == other.magic && this->version == other.version;
+  return this->magic == that.magic && this->version == that.version;
 }
 
 bool
-RefCountCacheHeader::compatible(RefCountCacheHeader *other) const
+RefCountCacheHeader::compatible(RefCountCacheHeader *that) const
 {
-  return (this->magic == other->magic && this->version._major == 
other->version._major &&
-          this->object_version._major == other->version._major);
+  return this->magic == that->magic && this->version == that->version && 
this->object_version == that->version;
 };

Reply via email to