From 6fddf31db31a6f3d0f9c6dd7e611543f56d6fc2f Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Tue, 12 Jun 2018 15:24:12 -0700 Subject: Improved rate limit logic for QoS/ACK packets. Also reduced how often processBackgroundPathMeasurements() is called --- node/Path.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'node/Path.hpp') diff --git a/node/Path.hpp b/node/Path.hpp index 80a7895a..71615d50 100644 --- a/node/Path.hpp +++ b/node/Path.hpp @@ -566,9 +566,9 @@ public: * @param now Current time */ inline void processBackgroundPathMeasurements(int64_t now, const int64_t peerId) { - Mutex::Lock _l(_statistics_m); // Compute path stability if (now - _lastPathQualityComputeTime > ZT_PATH_QUALITY_COMPUTE_INTERVAL) { + Mutex::Lock _l(_statistics_m); _lastPathQualityComputeTime = now; address().toString(_addrString); _meanThroughput = _throughputSamples->mean(); @@ -593,10 +593,8 @@ public: _lastComputedStability = pdv_contrib + latency_contrib + throughput_disturbance_contrib; _lastComputedStability *= 1 - _packetErrorRatio; _qualitySamples->push(_lastComputedStability); - } - // Prevent QoS records from sticking around for too long - if (now - _lastQoSRecordPurge > ZT_PATH_QOS_RECORD_PURGE_INTERVAL) - { + + // Prevent QoS records from sticking around for too long std::map::iterator it = _outQoSRecords.begin(); while (it != _outQoSRecords.end()) { // Time since egress of tracked packet -- cgit v1.2.3