]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: fix error category equivalence checks
authorCasey Bodley <cbodley@redhat.com>
Fri, 31 Aug 2018 18:04:41 +0000 (14:04 -0400)
committerYingxin <yingxin.cheng@intel.com>
Mon, 3 Sep 2018 08:29:26 +0000 (16:29 +0800)
consult base class for equivalence (which will match errors within
this category) before applying the extra error code mappings

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/crimson/net/Errors.cc

index e83c7c030ea0c18a585fe2fada30ab77144fd6c5..62d60ce1c7bd5a42d7039b2a5f7c537461afc24b 100644 (file)
@@ -63,6 +63,9 @@ const std::error_category& net_category()
     }
 
     bool equivalent(int code, const std::error_condition& cond) const noexcept override {
+      if (error_category::equivalent(code, cond)) {
+        return true;
+      }
       switch (static_cast<error>(code)) {
         case error::connection_aborted:
           return cond == std::errc::connection_aborted
@@ -79,6 +82,9 @@ const std::error_category& net_category()
     }
 
     bool equivalent(const std::error_code& code, int cond) const noexcept override {
+      if (error_category::equivalent(code, cond)) {
+        return true;
+      }
       switch (static_cast<error>(cond)) {
         case error::connection_aborted:
           return code == std::errc::connection_aborted