Refactor COM stuff a bit, and respond to COM requests a bit more readily for rapid setup. Will need to revisit later.
This commit is contained in:
parent
68e549233d
commit
d3524f3609
11 changed files with 94 additions and 154 deletions
|
@ -154,23 +154,6 @@ public:
|
|||
return nconf.com.agreesWith(_com);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return True if this member has been on this network recently (or network is public)
|
||||
*/
|
||||
inline bool recentlyAllowedOnNetwork(const NetworkConfig &nconf) const
|
||||
{
|
||||
if (nconf.isPublic())
|
||||
return true;
|
||||
if (_com) {
|
||||
const uint64_t a = _com.timestamp().first;
|
||||
if ((_blacklistBefore)&&(a <= _blacklistBefore))
|
||||
return false;
|
||||
const uint64_t b = nconf.com.timestamp().first;
|
||||
return ((a <= b) ? ((b - a) <= ZT_NETWORKCONFIG_DEFAULT_CREDENTIAL_TIME_MAX_MAX_DELTA) : true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a capability or tag is within its max delta from the timestamp of our network config and newer than any blacklist cutoff time
|
||||
*
|
||||
|
@ -259,10 +242,7 @@ public:
|
|||
*
|
||||
* @param ts Blacklist cutoff
|
||||
*/
|
||||
inline void blacklistBefore(const uint64_t ts)
|
||||
{
|
||||
_blacklistBefore = ts;
|
||||
}
|
||||
inline void blacklistBefore(const uint64_t ts) { _blacklistBefore = ts; }
|
||||
|
||||
/**
|
||||
* Clean up old or stale entries
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue