mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Revert "#ifdef'd out multipath/QoS statistics buffers allocations for ZT_PROTOCOL_VERSION<10"
This reverts commit 270debb3fc
.
This commit is contained in:
parent
993d850f69
commit
d4c0349de9
3 changed files with 2 additions and 8 deletions
|
@ -161,7 +161,6 @@ public:
|
||||||
|
|
||||||
~Path()
|
~Path()
|
||||||
{
|
{
|
||||||
#if ZT_PROTO_VERSION >= 10
|
|
||||||
delete _throughputSamples;
|
delete _throughputSamples;
|
||||||
delete _latencySamples;
|
delete _latencySamples;
|
||||||
delete _packetValiditySamples;
|
delete _packetValiditySamples;
|
||||||
|
@ -170,7 +169,6 @@ public:
|
||||||
_latencySamples = NULL;
|
_latencySamples = NULL;
|
||||||
_packetValiditySamples = NULL;
|
_packetValiditySamples = NULL;
|
||||||
_throughputDisturbanceSamples = NULL;
|
_throughputDisturbanceSamples = NULL;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -653,14 +651,12 @@ public:
|
||||||
* Initialize statistical buffers
|
* Initialize statistical buffers
|
||||||
*/
|
*/
|
||||||
inline void prepareBuffers() {
|
inline void prepareBuffers() {
|
||||||
#if ZT_PROTO_VERSION >= 10
|
|
||||||
_throughputSamples = new RingBuffer<uint64_t>(ZT_PATH_QUALITY_METRIC_WIN_SZ);
|
_throughputSamples = new RingBuffer<uint64_t>(ZT_PATH_QUALITY_METRIC_WIN_SZ);
|
||||||
_latencySamples = new RingBuffer<uint32_t>(ZT_PATH_QUALITY_METRIC_WIN_SZ);
|
_latencySamples = new RingBuffer<uint32_t>(ZT_PATH_QUALITY_METRIC_WIN_SZ);
|
||||||
_packetValiditySamples = new RingBuffer<bool>(ZT_PATH_QUALITY_METRIC_WIN_SZ);
|
_packetValiditySamples = new RingBuffer<bool>(ZT_PATH_QUALITY_METRIC_WIN_SZ);
|
||||||
_throughputDisturbanceSamples = new RingBuffer<float>(ZT_PATH_QUALITY_METRIC_WIN_SZ);
|
_throughputDisturbanceSamples = new RingBuffer<float>(ZT_PATH_QUALITY_METRIC_WIN_SZ);
|
||||||
memset(_ifname, 0, 16);
|
memset(_ifname, 0, 16);
|
||||||
memset(_addrString, 0, sizeof(_addrString));
|
memset(_addrString, 0, sizeof(_addrString));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -706,6 +702,8 @@ private:
|
||||||
float _lastComputedThroughputDistCoeff;
|
float _lastComputedThroughputDistCoeff;
|
||||||
unsigned char _lastAllocation;
|
unsigned char _lastAllocation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// cached human-readable strings for tracing purposes
|
// cached human-readable strings for tracing purposes
|
||||||
char _ifname[16];
|
char _ifname[16];
|
||||||
char _addrString[256];
|
char _addrString[256];
|
||||||
|
|
|
@ -78,9 +78,7 @@ Peer::Peer(const RuntimeEnvironment *renv,const Identity &myIdentity,const Ident
|
||||||
Utils::getSecureRandom(&_freeRandomByte, 1);
|
Utils::getSecureRandom(&_freeRandomByte, 1);
|
||||||
if (!myIdentity.agree(peerIdentity,_key,ZT_PEER_SECRET_KEY_LENGTH))
|
if (!myIdentity.agree(peerIdentity,_key,ZT_PEER_SECRET_KEY_LENGTH))
|
||||||
throw ZT_EXCEPTION_INVALID_ARGUMENT;
|
throw ZT_EXCEPTION_INVALID_ARGUMENT;
|
||||||
#if ZT_PROTO_VERSION >= 10
|
|
||||||
_pathChoiceHist = new RingBuffer<int>(ZT_MULTIPATH_PROPORTION_WIN_SZ);
|
_pathChoiceHist = new RingBuffer<int>(ZT_MULTIPATH_PROPORTION_WIN_SZ);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Peer::received(
|
void Peer::received(
|
||||||
|
|
|
@ -62,9 +62,7 @@ private:
|
||||||
public:
|
public:
|
||||||
~Peer() {
|
~Peer() {
|
||||||
Utils::burn(_key,sizeof(_key));
|
Utils::burn(_key,sizeof(_key));
|
||||||
#if ZT_PROTO_VERSION >= 10
|
|
||||||
delete _pathChoiceHist;
|
delete _pathChoiceHist;
|
||||||
#endif
|
|
||||||
_pathChoiceHist = NULL;
|
_pathChoiceHist = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue