diff options
| author | Joseph Henry <josephjah@gmail.com> | 2018-06-14 16:34:45 -0700 |
|---|---|---|
| committer | Joseph Henry <josephjah@gmail.com> | 2018-06-14 16:34:45 -0700 |
| commit | 17fbb020e733fab8d8be933bb4981927015a10f5 (patch) | |
| tree | 65147665e41c3c60b44b916ff4825afb07c9836c /node/Peer.hpp | |
| parent | f8005b88adfe93af477528bec748882da8fa9bea (diff) | |
| download | infinitytier-17fbb020e733fab8d8be933bb4981927015a10f5.tar.gz infinitytier-17fbb020e733fab8d8be933bb4981927015a10f5.zip | |
Added multipath field to zerotier-cli status output. Adjusted how path estimates are computed and cached
Diffstat (limited to 'node/Peer.hpp')
| -rw-r--r-- | node/Peer.hpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/node/Peer.hpp b/node/Peer.hpp index 9361f665..ddbe6f77 100644 --- a/node/Peer.hpp +++ b/node/Peer.hpp @@ -353,14 +353,18 @@ public: inline int64_t isActive(int64_t now) const { return ((now - _lastNontrivialReceive) < ZT_PEER_ACTIVITY_TIMEOUT); } /** - * @return Latency in milliseconds of best path or 0xffff if unknown / no paths + * @return Latency in milliseconds of best/aggregate path or 0xffff if unknown / no paths */ inline unsigned int latency(const int64_t now) { - SharedPtr<Path> bp(getAppropriatePath(now,false)); - if (bp) - return bp->latency(); - return 0xffff; + if (RR->node->getMultipathMode()) { + return (int)computeAggregateLinkMeanLatency(); + } else { + SharedPtr<Path> bp(getAppropriatePath(now,false)); + if (bp) + return bp->latency(); + return 0xffff; + } } /** |
