aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/core/pending_interest.h
diff options
context:
space:
mode:
authorMichele Papalini <micpapal@cisco.com>2023-02-02 17:49:46 +0100
committerMauro Sardara <msardara@cisco.com>2023-02-09 13:23:13 +0000
commite30c3a102081ccf345c457658dc557703fae67bb (patch)
tree81022d23ef15eb766f396e3f2d1e9f4b763ae4bf /libtransport/src/core/pending_interest.h
parentabf7c63f1cb45276f379770319ddb537104022e8 (diff)
fix(hicn): fix bugs reported by sonarqube
Ref: HICN-837 Signed-off-by: Michele Papalini <micpapal@cisco.com> Change-Id: I0d02a11361b1ba5ad50123b2dd142c961998922f (cherry picked from commit 8a7e75e84a31180d51b9970d526709ec4dca2030)
Diffstat (limited to 'libtransport/src/core/pending_interest.h')
-rw-r--r--libtransport/src/core/pending_interest.h8
1 files changed, 7 insertions, 1 deletions
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_); }