|
|
|
|
@ -188,7 +188,7 @@ void Peer::received(
|
|
|
|
|
if ((now - _lastPathConfirmationSent) >= ZT_MIN_PATH_CONFIRMATION_INTERVAL) { |
|
|
|
|
_lastPathConfirmationSent = now; |
|
|
|
|
TRACE("got %s via unknown path %s(%s), confirming...",Packet::verbString(verb),_id.address().toString().c_str(),remoteAddr.toString().c_str()); |
|
|
|
|
attemptToContactAt(RR,localAddr,remoteAddr,now); |
|
|
|
|
sendHELLO(RR,localAddr,remoteAddr,now); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
@ -198,7 +198,7 @@ void Peer::received(
|
|
|
|
|
|
|
|
|
|
#ifdef ZT_ENABLE_CLUSTER |
|
|
|
|
if ((RR->cluster)&&(pathIsConfirmed)) |
|
|
|
|
RR->cluster->replicateHavePeer(_id,remoteAddr); |
|
|
|
|
RR->cluster->replicateHavePeer(_id); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if (needMulticastGroupAnnounce) { |
|
|
|
|
@ -208,7 +208,7 @@ void Peer::received(
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Peer::attemptToContactAt(const RuntimeEnvironment *RR,const InetAddress &localAddr,const InetAddress &atAddress,uint64_t now) |
|
|
|
|
void Peer::sendHELLO(const RuntimeEnvironment *RR,const InetAddress &localAddr,const InetAddress &atAddress,uint64_t now) |
|
|
|
|
{ |
|
|
|
|
// _lock not required here since _id is immutable and nothing else is accessed
|
|
|
|
|
|
|
|
|
|
@ -242,7 +242,7 @@ bool Peer::doPingAndKeepalive(const RuntimeEnvironment *RR,uint64_t now,int inet
|
|
|
|
|
if (p) { |
|
|
|
|
if ((now - p->lastReceived()) >= ZT_PEER_DIRECT_PING_DELAY) { |
|
|
|
|
//TRACE("PING %s(%s) after %llums/%llums send/receive inactivity",_id.address().toString().c_str(),p->address().toString().c_str(),now - p->lastSend(),now - p->lastReceived());
|
|
|
|
|
attemptToContactAt(RR,p->localAddress(),p->address(),now); |
|
|
|
|
sendHELLO(RR,p->localAddress(),p->address(),now); |
|
|
|
|
p->sent(now); |
|
|
|
|
} else if (((now - p->lastSend()) >= ZT_NAT_KEEPALIVE_DELAY)&&(!p->reliable())) { |
|
|
|
|
//TRACE("NAT keepalive %s(%s) after %llums/%llums send/receive inactivity",_id.address().toString().c_str(),p->address().toString().c_str(),now - p->lastSend(),now - p->lastReceived());
|
|
|
|
|
@ -348,7 +348,7 @@ bool Peer::resetWithinScope(const RuntimeEnvironment *RR,InetAddress::IpScope sc
|
|
|
|
|
unsigned int y = 0; |
|
|
|
|
while (x < np) { |
|
|
|
|
if (_paths[x].address().ipScope() == scope) { |
|
|
|
|
attemptToContactAt(RR,_paths[x].localAddress(),_paths[x].address(),now); |
|
|
|
|
sendHELLO(RR,_paths[x].localAddress(),_paths[x].address(),now); |
|
|
|
|
} else { |
|
|
|
|
_paths[y++] = _paths[x]; |
|
|
|
|
} |
|
|
|
|
|