diff options
author | Joseph Henry <josephjah@gmail.com> | 2019-05-13 12:24:01 -0700 |
---|---|---|
committer | Joseph Henry <josephjah@gmail.com> | 2019-05-13 12:24:01 -0700 |
commit | 95ef13f7a1e9736f67882a5c0101b7939643e0fb (patch) | |
tree | 43c6d5f67151752b010baac62031419ab6b169a7 | |
parent | 298e1d5a74d22cc028a9402dace1ce5c65a86dbb (diff) | |
download | infinitytier-95ef13f7a1e9736f67882a5c0101b7939643e0fb.tar.gz infinitytier-95ef13f7a1e9736f67882a5c0101b7939643e0fb.zip |
Added divisor for ZT_PEER_ACTIVITY_TIMEOUT, gives quicker indication to status change in SDK
-rw-r--r-- | node/Node.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/node/Node.cpp b/node/Node.cpp index c9f38ad3..ffa4a700 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -340,7 +340,7 @@ ZT_ResultCode Node::processBackgroundTasks(void *tptr,int64_t now,volatile int64 // Update online status, post status change as event const bool oldOnline = _online; - _online = (((now - lastReceivedFromUpstream) < ZT_PEER_ACTIVITY_TIMEOUT)||(RR->topology->amUpstream())); + _online = (((now - lastReceivedFromUpstream) < (ZT_PEER_ACTIVITY_TIMEOUT / (ZT_SDK ? 16 : 1)))||(RR->topology->amUpstream())); if (oldOnline != _online) postEvent(tptr,_online ? ZT_EVENT_ONLINE : ZT_EVENT_OFFLINE); } catch ( ... ) { |