diff options
author | Michele Papalini <micpapal@cisco.com> | 2023-02-02 17:49:46 +0100 |
---|---|---|
committer | Michele Papalini <micpapal@cisco.com> | 2023-02-07 10:25:01 +0100 |
commit | 8a7e75e84a31180d51b9970d526709ec4dca2030 (patch) | |
tree | 48c1d88f0a5635e75fa9fc0eb898b861b42477e8 /libtransport/src/core | |
parent | b96d1545a8d2a173dc5911ed0bca3e04dbb02176 (diff) |
fix(hicn): fix bugs reported by sonarqube
Ref: HICN-837
Signed-off-by: Michele Papalini <micpapal@cisco.com>
Change-Id: I0d02a11361b1ba5ad50123b2dd142c961998922f
Diffstat (limited to 'libtransport/src/core')
-rw-r--r-- | libtransport/src/core/memif_connector.cc | 8 | ||||
-rw-r--r-- | libtransport/src/core/pending_interest.h | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/libtransport/src/core/memif_connector.cc b/libtransport/src/core/memif_connector.cc index fb38a6e23..a224beb11 100644 --- a/libtransport/src/core/memif_connector.cc +++ b/libtransport/src/core/memif_connector.cc @@ -55,7 +55,13 @@ MemifConnector::MemifConnector(PacketReceivedCallback &&receive_callback, log2_ring_size_(klog2_ring_size), max_memif_bufs_(1 << klog2_ring_size) {} -MemifConnector::~MemifConnector() { close(); } +MemifConnector::~MemifConnector() { + try { + close(); + } catch (errors::RuntimeException &e) { + // do nothing + } +} void MemifConnector::connect(uint32_t memif_id, long memif_mode, const std::string &socket_filename, diff --git a/libtransport/src/core/pending_interest.h b/libtransport/src/core/pending_interest.h index b901e7d97..f49348bac 100644 --- a/libtransport/src/core/pending_interest.h +++ b/libtransport/src/core/pending_interest.h @@ -62,7 +62,13 @@ class PendingInterest { timer_.async_wait(std::forward<Handler>(cb)); } - void cancelTimer() { timer_.cancel(); } + void cancelTimer() { + try { + timer_.cancel(); + } catch (asio::system_error &e) { + // do nothing + } + } Interest::Ptr &&getInterest() { return std::move(interest_); } |