diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-10 11:40:45 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-10 11:40:45 -0700 |
commit | 9e651b39e416171812d0dd3835a0cb9958aed264 (patch) | |
tree | 96c13a53faee912191467fed2d033458aae6f85b /node | |
parent | 08a11a6f32329d26e5e85b7f66e66591d2fd1069 (diff) | |
download | infinitytier-9e651b39e416171812d0dd3835a0cb9958aed264.tar.gz infinitytier-9e651b39e416171812d0dd3835a0cb9958aed264.zip |
Add some TRACE around pinging (for now), and refactor service/One to just run in the foreground as some platforms may not require threads at all.
Diffstat (limited to 'node')
-rw-r--r-- | node/Peer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp index 1926f2e5..541fe5dd 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -111,6 +111,7 @@ void Peer::received( * paths without confirming that a bidirectional link is in * fact present, but any packet that decodes and authenticates * correctly is considered valid. */ + TRACE("got non-confirmation packet from unknown path %s(%s), pinging...",_id.address().toString().c_str(),remoteAddr.toString().c_str()); attemptToContactAt(RR,remoteAddr,linkDesperation,now); } } @@ -193,12 +194,14 @@ void Peer::doPingAndKeepalive(const RuntimeEnvironment *RR,uint64_t now) if ((bestPath)&&(bestPath->active(now))) { const unsigned int desp = std::max(RR->node->coreDesperation(),bestPath->lastReceiveDesperation()); if ((now - bestPath->lastReceived()) >= ZT_PEER_DIRECT_PING_DELAY) { + TRACE("PING %s(%s) desperation == %u",_id.address().toString().c_str(),bestPath->address().toString().c_str(),desp); attemptToContactAt(RR,bestPath->address(),desp,now); bestPath->sent(now); } else if ((now - bestPath->lastSend()) >= ZT_NAT_KEEPALIVE_DELAY) { // We only do keepalive if desperation is zero right now, since higher // desperation paths involve things like tunneling that do not need it. if (desp == 0) { + TRACE("NAT keepalive %s(%s)",_id.address().toString().c_str(),bestPath->address().toString().c_str()); RR->node->putPacket(bestPath->address(),"",0,0); bestPath->sent(now); } |