|
@@ -188,7 +188,7 @@ void Peer::received(
|
|
if ((now - _lastPathConfirmationSent) >= ZT_MIN_PATH_CONFIRMATION_INTERVAL) {
|
|
if ((now - _lastPathConfirmationSent) >= ZT_MIN_PATH_CONFIRMATION_INTERVAL) {
|
|
_lastPathConfirmationSent = now;
|
|
_lastPathConfirmationSent = now;
|
|
TRACE("got %s via unknown path %s(%s), confirming...",Packet::verbString(verb),_id.address().toString().c_str(),remoteAddr.toString().c_str());
|
|
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
|
|
#ifdef ZT_ENABLE_CLUSTER
|
|
if ((RR->cluster)&&(pathIsConfirmed))
|
|
if ((RR->cluster)&&(pathIsConfirmed))
|
|
- RR->cluster->replicateHavePeer(_id,remoteAddr);
|
|
|
|
|
|
+ RR->cluster->replicateHavePeer(_id);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
if (needMulticastGroupAnnounce) {
|
|
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
|
|
// _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 (p) {
|
|
if ((now - p->lastReceived()) >= ZT_PEER_DIRECT_PING_DELAY) {
|
|
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());
|
|
//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);
|
|
p->sent(now);
|
|
} else if (((now - p->lastSend()) >= ZT_NAT_KEEPALIVE_DELAY)&&(!p->reliable())) {
|
|
} 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());
|
|
//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;
|
|
unsigned int y = 0;
|
|
while (x < np) {
|
|
while (x < np) {
|
|
if (_paths[x].address().ipScope() == scope) {
|
|
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 {
|
|
} else {
|
|
_paths[y++] = _paths[x];
|
|
_paths[y++] = _paths[x];
|
|
}
|
|
}
|