Bunch of fixes to startup, pinging, and choice of route. Also some TRACE updates.
This commit is contained in:
parent
6e076e77d8
commit
490e86dde3
6 changed files with 32 additions and 24 deletions
|
@ -700,7 +700,7 @@ bool Switch::_trySend(const Packet &packet,bool encrypt)
|
|||
uint64_t now = Utils::now();
|
||||
|
||||
SharedPtr<Peer> via;
|
||||
if ((_r->topology->isSupernode(peer->address()))||(peer->hasActiveDirectPath(now))) {
|
||||
if (peer->hasActiveDirectPath(now)) {
|
||||
via = peer;
|
||||
} else {
|
||||
via = _r->topology->getBestSupernode();
|
||||
|
@ -745,6 +745,14 @@ bool Switch::_trySend(const Packet &packet,bool encrypt)
|
|||
break;
|
||||
}
|
||||
|
||||
#ifdef ZT_TRACE
|
||||
if (via != peer) {
|
||||
TRACE(">> %s to %s via %s (%d)",Packet::verbString(packet.verb()),peer->address().toString().c_str(),via->address().toString().c_str(),(int)packet.size());
|
||||
} else {
|
||||
TRACE(">> %s to %s (%d)",Packet::verbString(packet.verb()),peer->address().toString().c_str(),(int)packet.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue