mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-20 13:24:09 -07:00
More tweaks to algorithm for determining when to fail over to TCP, and stop supernodes from resynchronizing unless explicitly ordered.
This commit is contained in:
parent
0e1fc06a6f
commit
700a450806
6 changed files with 71 additions and 44 deletions
|
@ -207,11 +207,10 @@ public:
|
|||
class PingPeersThatNeedPing
|
||||
{
|
||||
public:
|
||||
PingPeersThatNeedPing(const RuntimeEnvironment *renv,uint64_t now,bool firstSinceReset) throw() :
|
||||
PingPeersThatNeedPing(const RuntimeEnvironment *renv,uint64_t now) throw() :
|
||||
_now(now),
|
||||
_supernodeAddresses(renv->topology->supernodeAddresses()),
|
||||
_r(renv),
|
||||
_firstSinceReset(firstSinceReset) {}
|
||||
_r(renv) {}
|
||||
|
||||
inline void operator()(Topology &t,const SharedPtr<Peer> &p)
|
||||
{
|
||||
|
@ -228,14 +227,13 @@ public:
|
|||
/* 2b: peer is not a supernode */
|
||||
(!_supernodeAddresses.count(p->address()))
|
||||
)
|
||||
) { p->sendPing(_r,_now,_firstSinceReset); }
|
||||
) { p->sendPing(_r,_now); }
|
||||
}
|
||||
|
||||
private:
|
||||
uint64_t _now;
|
||||
std::set<Address> _supernodeAddresses;
|
||||
const RuntimeEnvironment *_r;
|
||||
bool _firstSinceReset;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue