mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-05-29 21:44:23 +00:00
cleanup
This commit is contained in:
parent
93b4ac5cb2
commit
2d6a4e5974
@ -517,19 +517,6 @@ void EmbeddedNetworkController::threadMain()
|
|||||||
lastUpdatedNetworkMemberCache = OSUtils::now();
|
lastUpdatedNetworkMemberCache = OSUtils::now();
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // Every 25ms we push up to 50 network refreshes, which amounts to a max of about 300-500kb/sec
|
|
||||||
unsigned int count = 0;
|
|
||||||
Mutex::Lock _l(_refreshQueue_m);
|
|
||||||
while (_refreshQueue.size() > 0) {
|
|
||||||
_Refresh &r = _refreshQueue.front();
|
|
||||||
//if (_node)
|
|
||||||
// _node->pushNetworkRefresh(r.dest,r.nwid,r.blacklistAddresses,r.blacklistThresholds,r.numBlacklistEntries);
|
|
||||||
_refreshQueue.pop_front();
|
|
||||||
if (++count >= 50)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread::sleep(25);
|
Thread::sleep(25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1230,15 +1217,6 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
|
|||||||
_networkMemberCache[nwid][Address(address)] = member;
|
_networkMemberCache[nwid][Address(address)] = member;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
Mutex::Lock _l(_refreshQueue_m);
|
|
||||||
_refreshQueue.push_back(_Refresh());
|
|
||||||
_Refresh &r = _refreshQueue.back();
|
|
||||||
r.dest = Address(address);
|
|
||||||
r.nwid = nwid;
|
|
||||||
r.numBlacklistEntries = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add non-persisted fields
|
// Add non-persisted fields
|
||||||
member["clock"] = now;
|
member["clock"] = now;
|
||||||
|
|
||||||
|
@ -204,18 +204,6 @@ private:
|
|||||||
std::map< std::pair<uint64_t,uint64_t>,uint64_t > _lastRequestTime;
|
std::map< std::pair<uint64_t,uint64_t>,uint64_t > _lastRequestTime;
|
||||||
Mutex _lastRequestTime_m;
|
Mutex _lastRequestTime_m;
|
||||||
|
|
||||||
// Queue of network member refreshes to be pushed
|
|
||||||
struct _Refresh
|
|
||||||
{
|
|
||||||
Address dest;
|
|
||||||
uint64_t nwid;
|
|
||||||
uint64_t blacklistAddresses[64];
|
|
||||||
uint64_t blacklistThresholds[64];
|
|
||||||
unsigned int numBlacklistEntries;
|
|
||||||
};
|
|
||||||
std::list< _Refresh > _refreshQueue;
|
|
||||||
Mutex _refreshQueue_m;
|
|
||||||
|
|
||||||
Thread _daemon;
|
Thread _daemon;
|
||||||
volatile bool _daemonRun;
|
volatile bool _daemonRun;
|
||||||
};
|
};
|
||||||
|
@ -40,7 +40,7 @@ const char *Packet::verbString(Verb v)
|
|||||||
case VERB_MULTICAST_LIKE: return "MULTICAST_LIKE";
|
case VERB_MULTICAST_LIKE: return "MULTICAST_LIKE";
|
||||||
case VERB_NETWORK_CREDENTIALS: return "NETWORK_CREDENTIALS";
|
case VERB_NETWORK_CREDENTIALS: return "NETWORK_CREDENTIALS";
|
||||||
case VERB_NETWORK_CONFIG_REQUEST: return "NETWORK_CONFIG_REQUEST";
|
case VERB_NETWORK_CONFIG_REQUEST: return "NETWORK_CONFIG_REQUEST";
|
||||||
case VERB_NETWORK_CONFIG: return "NETWORK_CONFIG_REFRESH";
|
case VERB_NETWORK_CONFIG: return "NETWORK_CONFIG";
|
||||||
case VERB_MULTICAST_GATHER: return "MULTICAST_GATHER";
|
case VERB_MULTICAST_GATHER: return "MULTICAST_GATHER";
|
||||||
case VERB_MULTICAST_FRAME: return "MULTICAST_FRAME";
|
case VERB_MULTICAST_FRAME: return "MULTICAST_FRAME";
|
||||||
case VERB_PUSH_DIRECT_PATHS: return "PUSH_DIRECT_PATHS";
|
case VERB_PUSH_DIRECT_PATHS: return "PUSH_DIRECT_PATHS";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user