summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichele papalini <micpapal@cisco.com>2019-10-14 11:10:19 +0200
committermichele papalini <micpapal@cisco.com>2019-10-14 11:10:19 +0200
commit9a7c55f13bc399c89d47c02d1f08eccf3bb5df5e (patch)
tree7c1637062ac6b6f1a9aac80b2963900add863808
parenteefc7ae95bbd680416163e5617bada1949b32afc (diff)
[HICN-322] fix timeouts inside portal
Signed-off-by: michele papalini <micpapal@cisco.com> Change-Id: I4ac176a11ed6f0b964274240dc0969051911183d
-rw-r--r--libtransport/src/hicn/transport/core/portal.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/libtransport/src/hicn/transport/core/portal.h b/libtransport/src/hicn/transport/core/portal.h
index 3ea37c938..17f35d819 100644
--- a/libtransport/src/hicn/transport/core/portal.h
+++ b/libtransport/src/hicn/transport/core/portal.h
@@ -417,8 +417,14 @@ class Portal {
pending_interest->startCountdown(portal_details::makeCustomAllocatorHandler(
async_callback_memory_, std::bind(&Portal<ForwarderInt>::timerHandler,
this, std::placeholders::_1, hash)));
- pending_interest_hash_table_.emplace(
- std::make_pair(hash, std::move(pending_interest)));
+
+ auto it = pending_interest_hash_table_.find(hash);
+ if(it != pending_interest_hash_table_.end()){
+ it->second->cancelTimer();
+ it->second = std::move(pending_interest);
+ }else{
+ pending_interest_hash_table_[hash] = std::move(pending_interest);
+ }
}
/**