Tighten up credential push just a bit for faster up-time with older nodes, should not have significant impact on bandwidth. Also some cleanup and push direct path timing fixes.

This commit is contained in:
Adam Ierymenko 2019-06-25 13:42:20 -07:00
parent a3ef9b8a15
commit a019c3dd5d
8 changed files with 52 additions and 20 deletions

View file

@ -78,6 +78,14 @@ public:
*/
void pushCredentials(const RuntimeEnvironment *RR,void *tPtr,const int64_t now,const Address &peerAddress,const NetworkConfig &nconf,int localCapabilityIndex);
/**
* @return True if we haven't pushed credentials in a long time (to cause proactive credential push)
*/
inline bool shouldPushCredentials(const int64_t now) const
{
return ((now - _lastPushedCredentials) > ZT_PEER_ACTIVITY_TIMEOUT);
}
/**
* Check whether we should push MULTICAST_LIKEs to this peer, and update last sent time if true
*
@ -213,6 +221,9 @@ private:
// Revocation threshold for COM or 0 if none
int64_t _comRevocationThreshold;
// Time we last pushed credentials
int64_t _lastPushedCredentials;
// Remote member's latest network COM
CertificateOfMembership _com;