aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn
diff options
context:
space:
mode:
authormichele papalini <micpapal@cisco.com>2019-10-09 10:07:38 +0200
committermichele papalini <micpapal@cisco.com>2019-10-09 10:07:38 +0200
commitd61668ec9ee63307eef161e197e09981f327b984 (patch)
tree9fb94854e5cefb6b3e6c686e850ee8dd372d45c7 /libtransport/src/hicn
parent4802315ae6800dd9c433296f9012373244df19e5 (diff)
[HICN-308] delete interests from interest map
Signed-off-by: michele papalini <micpapal@cisco.com> Change-Id: Ie69909e3984faac777f9fc3b3e0625e8de3a7771
Diffstat (limited to 'libtransport/src/hicn')
-rw-r--r--libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
index 446b9ef8e..5667b0640 100644
--- a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
+++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
@@ -82,6 +82,7 @@ RTCProducerSocket::RTCProducerSocket()
bytesProductionRate_(INIT_PACKET_PRODUCTION_RATE * 1400),
packetsProductionRate_(INIT_PACKET_PRODUCTION_RATE),
perSecondFactor_(MILLI_IN_A_SEC / STATS_INTERVAL_DURATION),
+ timer_on_(false),
active_(false) {
lastStats_ = std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now().time_since_epoch())
@@ -183,6 +184,7 @@ void RTCProducerSocket::produce(std::unique_ptr<utils::MemBuf> &&buffer) {
break;
}
}
+ seqs_map_.erase(it_seqs);
}
}
@@ -214,9 +216,14 @@ void RTCProducerSocket::onInterest(Interest::Ptr &&interest) {
}
}
+ if(interestSeg > HICN_MAX_DATA_SEQ){
+ sendNack(interestSeg, isActive);
+ return;
+ }
+
// if the production rate is less than MIN_PRODUCTION_RATE we put the
// interest in a queue, otherwise we handle it in the usual way
- if(bytesProductionRate_ < MIN_PRODUCTION_RATE){
+ if(bytesProductionRate_ < MIN_PRODUCTION_RATE && interestSeg > currentSeg_){
utils::SpinLock::Acquire locked(interests_cache_lock_);
@@ -269,11 +276,6 @@ void RTCProducerSocket::onInterest(Interest::Ptr &&interest) {
return;
}
- if(interestSeg > HICN_MAX_DATA_SEQ){
- sendNack(interestSeg, isActive);
- return;
- }
-
if (TRANSPORT_EXPECT_FALSE(!isActive)) {
sendNack(interestSeg, false);
return;