From 2ac56fd120c3c9dd924fccc169beed2d51658ba9 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 26 Mar 2014 17:59:45 -0700 Subject: Fix TCP connection accumulation problem, still having issues with TCP tunneling. --- node/Node.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'node/Node.cpp') 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 > sns(_r->topology->supernodePeers()); TRACE("pinging %d supernodes",(int)sns.size()); -- cgit v1.2.3