mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
Fix a possible excessive memory use issue in controller and clean up a bunch of COM handling and other code in the normal node.
This commit is contained in:
parent
fe0068da52
commit
ef08346a74
8 changed files with 17 additions and 18 deletions
|
@ -1854,7 +1854,7 @@ void EmbeddedNetworkController::_startThreads()
|
|||
for(auto s=_expiringSoon.begin();s!=_expiringSoon.end();) {
|
||||
const int64_t when = s->first;
|
||||
if (when <= now) {
|
||||
// The user MAY have re-authorized, so we must actually look it up and check.
|
||||
// The user may have re-authorized, so we must actually look it up and check.
|
||||
network.clear();
|
||||
member.clear();
|
||||
if (_db.get(s->second.networkId, network, s->second.nodeId, member)) {
|
||||
|
|
|
@ -117,6 +117,7 @@ private:
|
|||
uint64_t networkId;
|
||||
uint64_t nodeId;
|
||||
inline bool operator==(const _MemberStatusKey &k) const { return ((k.networkId == networkId)&&(k.nodeId == nodeId)); }
|
||||
inline bool operator<(const _MemberStatusKey &k) const { return (k.networkId < networkId) || ((k.networkId == networkId)&&(k.nodeId < nodeId)); }
|
||||
};
|
||||
struct _MemberStatus
|
||||
{
|
||||
|
@ -154,7 +155,7 @@ private:
|
|||
std::unordered_map< _MemberStatusKey,_MemberStatus,_MemberStatusHash > _memberStatus;
|
||||
std::mutex _memberStatus_l;
|
||||
|
||||
std::multimap< int64_t, _MemberStatusKey > _expiringSoon;
|
||||
std::set< std::pair<int64_t, _MemberStatusKey> > _expiringSoon;
|
||||
std::mutex _expiringSoon_l;
|
||||
|
||||
RedisConfig *_rc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue