mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-19 11:16:32 +00:00
Cancel NAT-t attempts if peer is no longer "alive"
This commit is contained in:
parent
5986d83738
commit
21e6850722
@ -452,8 +452,8 @@ unsigned long Switch::doTimerTasks(uint64_t now)
|
||||
Mutex::Lock _l(_contactQueue_m);
|
||||
for(std::list<ContactQueueEntry>::iterator qi(_contactQueue.begin());qi!=_contactQueue.end();) {
|
||||
if (now >= qi->fireAtTime) {
|
||||
if (qi->peer->hasActiveDirectPath(now)) {
|
||||
// We've successfully NAT-t'd, so cancel attempt
|
||||
if ((!qi->peer->alive(now))||(qi->peer->hasActiveDirectPath(now))) {
|
||||
// Cancel attempt if we've already connected or peer is no longer "alive"
|
||||
_contactQueue.erase(qi++);
|
||||
continue;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user