fw: rename n-silent-timeouts to max-timeouts in AsfStrategy
Change-Id: Ie2790a4e1fd545aacf8b297d7ec33b204f2cdbfc
diff --git a/daemon/fw/asf-measurements.hpp b/daemon/fw/asf-measurements.hpp
index 02f4553..aede00b 100644
--- a/daemon/fw/asf-measurements.hpp
+++ b/daemon/fw/asf-measurements.hpp
@@ -91,15 +91,15 @@
}
size_t
- getNSilentTimeouts() const
+ getNTimeouts() const
{
- return m_nSilentTimeouts;
+ return m_nTimeouts;
}
void
- setNSilentTimeouts(size_t nSilentTimeouts)
+ setNTimeouts(size_t nTimeouts)
{
- m_nSilentTimeouts = nSilentTimeouts;
+ m_nTimeouts = nTimeouts;
}
public:
@@ -110,7 +110,7 @@
ndn::util::RttEstimator m_rttEstimator;
time::nanoseconds m_lastRtt = RTT_NO_MEASUREMENT;
Name m_lastInterestName;
- size_t m_nSilentTimeouts = 0;
+ size_t m_nTimeouts = 0;
// Timeout associated with measurement
scheduler::ScopedEventId m_measurementExpiration;
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index f337a27..df38099 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -58,7 +58,7 @@
this->setInstanceName(makeInstanceName(name, getStrategyName()));
NFD_LOG_DEBUG("probing-interval=" << m_probing.getProbingInterval()
- << " n-silent-timeouts=" << m_nMaxSilentTimeouts);
+ << " max-timeouts=" << m_nMaxTimeouts);
}
const Name&
@@ -97,11 +97,13 @@
if (f == "probing-interval") {
m_probing.setProbingInterval(getParamValue(f, s));
}
- else if (f == "n-silent-timeouts") {
- m_nMaxSilentTimeouts = getParamValue(f, s);
+ else if (f == "max-timeouts") {
+ m_nMaxTimeouts = getParamValue(f, s);
+ if (m_nMaxTimeouts <= 0)
+ NDN_THROW(std::invalid_argument("max-timeouts should be greater than 0"));
}
else {
- NDN_THROW(std::invalid_argument("Parameter should be probing-interval or n-silent-timeouts"));
+ NDN_THROW(std::invalid_argument("Parameter should be probing-interval or max-timeouts"));
}
}
}
@@ -341,10 +343,10 @@
}
auto& faceInfo = *fiPtr;
- size_t nTimeouts = faceInfo.getNSilentTimeouts() + 1;
- faceInfo.setNSilentTimeouts(nTimeouts);
+ size_t nTimeouts = faceInfo.getNTimeouts() + 1;
+ faceInfo.setNTimeouts(nTimeouts);
- if (nTimeouts <= m_nMaxSilentTimeouts && !isNack) {
+ if (nTimeouts < m_nMaxTimeouts && !isNack) {
NFD_LOG_TRACE(interestName << " face=" << faceId << " timeout-count=" << nTimeouts << " ignoring");
// Extend lifetime for measurements associated with Face
namespaceInfo->extendFaceInfoLifetime(faceInfo, faceId);
diff --git a/daemon/fw/asf-strategy.hpp b/daemon/fw/asf-strategy.hpp
index 2e0ba24..af3e4b5 100644
--- a/daemon/fw/asf-strategy.hpp
+++ b/daemon/fw/asf-strategy.hpp
@@ -91,7 +91,7 @@
AsfMeasurements m_measurements;
ProbingModule m_probing;
RetxSuppressionExponential m_retxSuppression;
- size_t m_nMaxSilentTimeouts = 3;
+ size_t m_nMaxTimeouts = 3;
static const time::milliseconds RETX_SUPPRESSION_INITIAL;
static const time::milliseconds RETX_SUPPRESSION_MAX;