mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
Cancel NAT-t attempts if peer is no longer "alive"
This commit is contained in:
parent
5986d83738
commit
21e6850722
1 changed files with 2 additions and 2 deletions
|
@ -452,8 +452,8 @@ unsigned long Switch::doTimerTasks(uint64_t now)
|
||||||
Mutex::Lock _l(_contactQueue_m);
|
Mutex::Lock _l(_contactQueue_m);
|
||||||
for(std::list<ContactQueueEntry>::iterator qi(_contactQueue.begin());qi!=_contactQueue.end();) {
|
for(std::list<ContactQueueEntry>::iterator qi(_contactQueue.begin());qi!=_contactQueue.end();) {
|
||||||
if (now >= qi->fireAtTime) {
|
if (now >= qi->fireAtTime) {
|
||||||
if (qi->peer->hasActiveDirectPath(now)) {
|
if ((!qi->peer->alive(now))||(qi->peer->hasActiveDirectPath(now))) {
|
||||||
// We've successfully NAT-t'd, so cancel attempt
|
// Cancel attempt if we've already connected or peer is no longer "alive"
|
||||||
_contactQueue.erase(qi++);
|
_contactQueue.erase(qi++);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue