summaryrefslogtreecommitdiff
path: root/node/Node.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-26 17:59:45 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-26 17:59:45 -0700
commit2ac56fd120c3c9dd924fccc169beed2d51658ba9 (patch)
treebb17861516a42791f2f3545abc3871d59e53d3da /node/Node.cpp
parente6b23059aca4947c8c4638c5d5e0abdba3b2b7b7 (diff)
downloadinfinitytier-2ac56fd120c3c9dd924fccc169beed2d51658ba9.tar.gz
infinitytier-2ac56fd120c3c9dd924fccc169beed2d51658ba9.zip
Fix TCP connection accumulation problem, still having issues with TCP tunneling.
Diffstat (limited to 'node/Node.cpp')
-rw-r--r--node/Node.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/node/Node.cpp b/node/Node.cpp
index 20a049bc..95e4bb1d 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -577,8 +577,9 @@ Node::ReasonForTermination Node::run()
}
// Ping supernodes separately for two reasons: (1) supernodes only ping each
- // other, and (2) we still want to ping them first on resynchronize.
- if ((resynchronize)||((now - lastSupernodePing) >= ZT_PEER_DIRECT_PING_DELAY)) {
+ // other, and (2) we still want to ping them first on resynchronize. Also ping
+ // more aggressively if nothing seems to be happening at all.
+ if ((resynchronize)||((now - lastSupernodePing) >= ZT_PEER_DIRECT_PING_DELAY)||((now - _r->timeOfLastPacketReceived) >= ZT_PING_UNANSWERED_AFTER)) {
lastSupernodePing = now;
std::vector< SharedPtr<Peer> > sns(_r->topology->supernodePeers());
TRACE("pinging %d supernodes",(int)sns.size());