Selaa lähdekoodia

Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev

Grant Limberg 6 vuotta sitten
vanhempi
commit
c35933cd1e
1 muutettua tiedostoa jossa 1 lisäystä ja 4 poistoa
  1. 1 4
      service/OneService.cpp

+ 1 - 4
service/OneService.cpp

@@ -607,16 +607,13 @@ public:
 		_ports[1] = 0;
 		_ports[1] = 0;
 		_ports[2] = 0;
 		_ports[2] = 0;
 
 
+		_incomingPacketConcurrency = std::max((unsigned long)1,std::min((unsigned long)16,(unsigned long)std::thread::hardware_concurrency()));
 		char *envPool = std::getenv("INCOMING_PACKET_CONCURRENCY");
 		char *envPool = std::getenv("INCOMING_PACKET_CONCURRENCY");
 		if (envPool != NULL) {
 		if (envPool != NULL) {
 			int tmp = atoi(envPool);
 			int tmp = atoi(envPool);
 			if (tmp > 0) {
 			if (tmp > 0) {
 				_incomingPacketConcurrency = tmp;
 				_incomingPacketConcurrency = tmp;
-			} else {
-				_incomingPacketConcurrency = std::max((unsigned long)1,std::min((unsigned long)16,(unsigned long)std::thread::hardware_concurrency()));
 			}
 			}
-		} else {
-			_incomingPacketConcurrency = std::max((unsigned long)1,std::min((unsigned long)16,(unsigned long)std::thread::hardware_concurrency()));
 		}
 		}
 		for(long t=0;t<_incomingPacketConcurrency;++t) {
 		for(long t=0;t<_incomingPacketConcurrency;++t) {
 			_incomingPacketThreads.push_back(std::thread([this]() {
 			_incomingPacketThreads.push_back(std::thread([this]() {