mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 13:03:45 +02:00
More experimentation with multicast rate.
This commit is contained in:
parent
55e7ddba1e
commit
07e1085dcc
2 changed files with 12 additions and 0 deletions
|
@ -121,6 +121,15 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Most recent balance without update
|
||||||
|
*/
|
||||||
|
inline uint32_t balance() const
|
||||||
|
throw()
|
||||||
|
{
|
||||||
|
return _balance;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double _lastTime;
|
double _lastTime;
|
||||||
uint32_t _balance;
|
uint32_t _balance;
|
||||||
|
|
|
@ -581,6 +581,9 @@ public:
|
||||||
bal = _multicastRateAccounts.insert(std::pair< std::pair<Address,MulticastGroup>,BandwidthAccount >(k,BandwidthAccount(r.preload,r.maxBalance,r.accrual))).first;
|
bal = _multicastRateAccounts.insert(std::pair< std::pair<Address,MulticastGroup>,BandwidthAccount >(k,BandwidthAccount(r.preload,r.maxBalance,r.accrual))).first;
|
||||||
}
|
}
|
||||||
return bal->second.deduct(bytes);
|
return bal->second.deduct(bytes);
|
||||||
|
//bool tmp = bal->second.deduct(bytes);
|
||||||
|
//printf("%s: BAL: %u\n",mg.toString().c_str(),(unsigned int)bal->second.balance());
|
||||||
|
//return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Reference in a new issue