summaryrefslogtreecommitdiff
path: root/node/Switch.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-01-30 14:23:52 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-01-30 14:23:52 -0800
commit490e86dde3532b36617548bdf9d952caa43dffa3 (patch)
treea99d2a2d3b7179054f98b27db47bb1108e55b7ce /node/Switch.cpp
parent6e076e77d82ef78d407fab66b235fe936c02d13a (diff)
downloadinfinitytier-490e86dde3532b36617548bdf9d952caa43dffa3.tar.gz
infinitytier-490e86dde3532b36617548bdf9d952caa43dffa3.zip
Bunch of fixes to startup, pinging, and choice of route. Also some TRACE updates.
Diffstat (limited to 'node/Switch.cpp')
-rw-r--r--node/Switch.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp
index 9ec15411..6c7d0fc9 100644
--- a/node/Switch.cpp
+++ b/node/Switch.cpp
@@ -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;