Added multipath field to zerotier-cli status output. Adjusted how path estimates are computed and cached

This commit is contained in:
Joseph Henry 2018-06-14 16:34:45 -07:00
parent f8005b88ad
commit 17fbb020e7
6 changed files with 169 additions and 47 deletions

View file

@ -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;
}
}
/**