mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Fix bug in peer count.
This commit is contained in:
parent
4c24e0cfb0
commit
68d6d3c4ff
3 changed files with 5 additions and 5 deletions
|
@ -634,7 +634,7 @@ void Cluster::status(ZT_ClusterStatus &status) const
|
||||||
ms[_id]->x = _x;
|
ms[_id]->x = _x;
|
||||||
ms[_id]->y = _y;
|
ms[_id]->y = _y;
|
||||||
ms[_id]->z = _z;
|
ms[_id]->z = _z;
|
||||||
ms[_id]->peers = RR->topology->countAlive();
|
ms[_id]->peers = RR->topology->countActive();
|
||||||
for(std::vector<InetAddress>::const_iterator ep(_zeroTierPhysicalEndpoints.begin());ep!=_zeroTierPhysicalEndpoints.end();++ep) {
|
for(std::vector<InetAddress>::const_iterator ep(_zeroTierPhysicalEndpoints.begin());ep!=_zeroTierPhysicalEndpoints.end();++ep) {
|
||||||
if (ms[_id]->numZeroTierPhysicalEndpoints >= ZT_CLUSTER_MAX_ZT_PHYSICAL_ADDRESSES) // sanity check
|
if (ms[_id]->numZeroTierPhysicalEndpoints >= ZT_CLUSTER_MAX_ZT_PHYSICAL_ADDRESSES) // sanity check
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -308,7 +308,7 @@ void Topology::clean(uint64_t now)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long Topology::countAlive() const
|
unsigned long Topology::countActive() const
|
||||||
{
|
{
|
||||||
const uint64_t now = RR->node->now();
|
const uint64_t now = RR->node->now();
|
||||||
unsigned long cnt = 0;
|
unsigned long cnt = 0;
|
||||||
|
@ -317,7 +317,7 @@ unsigned long Topology::countAlive() const
|
||||||
Address *a = (Address *)0;
|
Address *a = (Address *)0;
|
||||||
SharedPtr<Peer> *p = (SharedPtr<Peer> *)0;
|
SharedPtr<Peer> *p = (SharedPtr<Peer> *)0;
|
||||||
while (i.next(a,p)) {
|
while (i.next(a,p)) {
|
||||||
if ((*p)->alive(now))
|
if ((*p)->hasActiveDirectPath(now))
|
||||||
++cnt;
|
++cnt;
|
||||||
}
|
}
|
||||||
return cnt;
|
return cnt;
|
||||||
|
|
|
@ -210,9 +210,9 @@ public:
|
||||||
void clean(uint64_t now);
|
void clean(uint64_t now);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Number of 'alive' peers
|
* @return Number of peers with active direct paths
|
||||||
*/
|
*/
|
||||||
unsigned long countAlive() const;
|
unsigned long countActive() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply a function or function object to all peers
|
* Apply a function or function object to all peers
|
||||||
|
|
Loading…
Add table
Reference in a new issue