The concept of link desperation (escalating to less desirable transports) simplifies a ton of stuff. Loads of spaghetti logic can die since we no longer have to make these decisions down in the core.
This commit is contained in:
parent
5f51653f9c
commit
a69e1876f1
11 changed files with 180 additions and 428 deletions
|
@ -251,10 +251,7 @@ void Topology::clean(uint64_t now)
|
|||
for(std::map< Address,SharedPtr<Peer> >::iterator p(_activePeers.begin());p!=_activePeers.end();) {
|
||||
if (((now - p->second->lastUsed()) >= ZT_PEER_IN_MEMORY_EXPIRATION)&&(std::find(_supernodeAddresses.begin(),_supernodeAddresses.end(),p->first) == _supernodeAddresses.end())) {
|
||||
_activePeers.erase(p++);
|
||||
} else {
|
||||
p->second->clean(now);
|
||||
++p;
|
||||
}
|
||||
} else ++p;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue