wiring more stuff up, and simplification of timing loops

This commit is contained in:
Adam Ierymenko 2019-08-23 07:04:20 -07:00
parent 37047a39f9
commit 0731f3f1a9
No known key found for this signature in database
GPG key ID: 1657198823E52A61
10 changed files with 229 additions and 228 deletions

View file

@ -480,6 +480,18 @@ public:
return (_QoSCutoffCount < ZT_PATH_QOS_ACK_CUTOFF_LIMIT);
}
/**
* Rate limit gate for trying externally defined or static path
*/
inline bool rateGateTryStaticPath(const int64_t now)
{
if ((now - _lastTriedStaticPath) >= ZT_PEER_PING_PERIOD) {
_lastTriedStaticPath = now;
return true;
}
return false;
}
/**
* @return Whether this peer is reachable via an aggregate link
*/
@ -503,6 +515,7 @@ private:
int64_t _lastACKWindowReset;
int64_t _lastQoSWindowReset;
int64_t _lastMultipathCompatibilityCheck;
int64_t _lastTriedStaticPath;
int _uniqueAlivePathCount;