ndn-traffic-client: correcting few counter initializations and code
change to handle high interest rate scenarios
Change-Id: I0c8fd5edcf6821c19fbaf71722f824d2f579fccf
refs: #1143
diff --git a/src/ndn-traffic-client.cpp b/src/ndn-traffic-client.cpp
index 2b9f2f5..011c5e1 100644
--- a/src/ndn-traffic-client.cpp
+++ b/src/ndn-traffic-client.cpp
@@ -40,6 +40,7 @@
, m_nMaximumInterests(-1)
, m_nInterestsSent(0)
, m_nInterestsReceived(0)
+ , m_nContentInconsistencies(0)
, m_minimumInterestRoundTripTime(std::numeric_limits<double>::max())
, m_maximumInterestRoundTripTime(0)
, m_totalInterestRoundTripTime(0)
@@ -63,8 +64,8 @@
, m_nonceDuplicationPercentage(-1)
, m_scope(-1)
, m_interestLifetime(getDefaultInterestLifetime())
- , m_nInterestsSent(-1)
- , m_nInterestsReceived(-1)
+ , m_nInterestsSent(0)
+ , m_nInterestsReceived(0)
, m_minimumInterestRoundTripTime(std::numeric_limits<double>::max())
, m_maximumInterestRoundTripTime(0)
, m_totalInterestRoundTripTime(0)
@@ -553,7 +554,7 @@
m_trafficPatterns[patternId].m_maximumInterestRoundTripTime = roundTripTime;
m_totalInterestRoundTripTime += roundTripTime;
m_trafficPatterns[patternId].m_totalInterestRoundTripTime += roundTripTime;
- if (m_nMaximumInterests >= 0 && m_nInterestsSent == m_nMaximumInterests)
+ if (m_nMaximumInterests >= 0 && globalReference == m_nMaximumInterests)
{
logStatistics();
m_logger.shutdownLogger();
@@ -574,7 +575,7 @@
logLine += ", LocalID=" + boost::lexical_cast<std::string>(localReference);
logLine += ", Name=" + interest.getName().toUri();
m_logger.log(logLine, true, false);
- if (m_nMaximumInterests >= 0 && m_nInterestsSent == m_nMaximumInterests)
+ if (m_nMaximumInterests >= 0 && globalReference == m_nMaximumInterests)
{
logStatistics();
m_logger.shutdownLogger();