summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-05-22 14:52:23 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-05-22 14:52:23 -0700
commit9774f789f21c05267ef35cc35684b0a7ce2efb2a (patch)
tree8ca8c0c0ac9910f7d40845ddf419120ea56fbb48 /node
parentcdec05af24f129ed12cf2b43eaa876521c358a0b (diff)
downloadinfinitytier-9774f789f21c05267ef35cc35684b0a7ce2efb2a.tar.gz
infinitytier-9774f789f21c05267ef35cc35684b0a7ce2efb2a.zip
TCP fallback tunneling is now working. That hurt more than expected.
Diffstat (limited to 'node')
-rw-r--r--node/Node.cpp8
-rw-r--r--node/Node.hpp1
2 files changed, 1 insertions, 8 deletions
diff --git a/node/Node.cpp b/node/Node.cpp
index 6b3f1f2c..c5c9873c 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -77,7 +77,6 @@ Node::Node(
_networks(),
_networks_m(),
_now(now),
- _startTimeAfterInactivity(0),
_lastPingCheck(0),
_lastHousekeepingRun(0),
_lastBeacon(0)
@@ -217,17 +216,12 @@ ZT1_ResultCode Node::processBackgroundTasks(uint64_t now,volatile uint64_t *next
if ((now - _lastPingCheck) >= ZT_PING_CHECK_INVERVAL) {
_lastPingCheck = now;
- // This is used to compute whether we appear to be "online" or not
- if ((now - _startTimeAfterInactivity) > (ZT_PING_CHECK_INVERVAL * 3))
- _startTimeAfterInactivity = now;
-
try {
_PingPeersThatNeedPing pfunc(RR,now);
RR->topology->eachPeer<_PingPeersThatNeedPing &>(pfunc);
- const uint64_t lastActivityAgo = now - std::max(_startTimeAfterInactivity,pfunc.lastReceiveFromUpstream);
bool oldOnline = _online;
- _online = (lastActivityAgo < ZT_PEER_ACTIVITY_TIMEOUT);
+ _online = ((now - pfunc.lastReceiveFromUpstream) < ZT_PEER_ACTIVITY_TIMEOUT);
if (oldOnline != _online)
postEvent(_online ? ZT1_EVENT_ONLINE : ZT1_EVENT_OFFLINE);
} catch ( ... ) {
diff --git a/node/Node.hpp b/node/Node.hpp
index f8678115..1d9372e4 100644
--- a/node/Node.hpp
+++ b/node/Node.hpp
@@ -229,7 +229,6 @@ private:
Mutex _backgroundTasksLock;
uint64_t _now;
- uint64_t _startTimeAfterInactivity;
uint64_t _lastPingCheck;
uint64_t _lastHousekeepingRun;
uint64_t _lastBeacon;