A few more tweaks to TCP failover... seems to be switching back and forth pretty well now!

This commit is contained in:
Adam Ierymenko
2014-04-03 17:12:34 -07:00
parent 158002d2d1
commit fe85426df6
4 changed files with 38 additions and 47 deletions

View File

@ -235,7 +235,7 @@ public:
* than time of last send in order to only count full round trips. */
if ( (!_supernodeAddresses.count(p->address())) &&
((_now - p->lastFrame()) < ZT_PEER_PATH_ACTIVITY_TIMEOUT) &&
((_now - p->lastDirectReceive()) > ZT_PEER_DIRECT_PING_DELAY) ) {
((_now - p->lastDirectReceive()) > ZT_PEER_DIRECT_PING_DELAY) ) {
p->sendPing(_r,_now);
}
}
@ -261,7 +261,7 @@ public:
/* For supernodes we always ping even if no frames have been seen, and
* we ping aggressively if pings are unanswered. The limit to this
* frequency is set in the main loop to no more than ZT_STARTUP_AGGRO. */
if ( (p->pingUnanswered(_r,_now)) || ((_now - p->lastDirectReceive()) > ZT_PEER_DIRECT_PING_DELAY) )
if ( (p->pingUnanswered(_r,_now)) || ((_now - p->lastDirectReceive()) > ZT_PEER_DIRECT_PING_DELAY) || (p->lastDirectReceive() < _r->timeOfLastResynchronize) )
p->sendPing(_r,_now);
}