mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 13:07:55 +00:00
Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev
This commit is contained in:
commit
801401a6e7
@ -33,6 +33,7 @@
|
||||
#include <libpq-fe.h>
|
||||
#include <sstream>
|
||||
#include <amqp.h>
|
||||
#include <amqp_tcp_socket.h>
|
||||
|
||||
using json = nlohmann::json;
|
||||
namespace {
|
||||
|
@ -161,6 +161,7 @@ public:
|
||||
|
||||
~Path()
|
||||
{
|
||||
#if ZT_PROTO_VERSION >= 10
|
||||
delete _throughputSamples;
|
||||
delete _latencySamples;
|
||||
delete _packetValiditySamples;
|
||||
@ -169,6 +170,7 @@ public:
|
||||
_latencySamples = NULL;
|
||||
_packetValiditySamples = NULL;
|
||||
_throughputDisturbanceSamples = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -651,12 +653,14 @@ public:
|
||||
* Initialize statistical buffers
|
||||
*/
|
||||
inline void prepareBuffers() {
|
||||
#if ZT_PROTO_VERSION >= 10
|
||||
_throughputSamples = new RingBuffer<uint64_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);
|
||||
_throughputDisturbanceSamples = new RingBuffer<float>(ZT_PATH_QUALITY_METRIC_WIN_SZ);
|
||||
memset(_ifname, 0, 16);
|
||||
memset(_addrString, 0, sizeof(_addrString));
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
@ -702,8 +706,6 @@ private:
|
||||
float _lastComputedThroughputDistCoeff;
|
||||
unsigned char _lastAllocation;
|
||||
|
||||
|
||||
|
||||
// cached human-readable strings for tracing purposes
|
||||
char _ifname[16];
|
||||
char _addrString[256];
|
||||
|
@ -78,7 +78,9 @@ Peer::Peer(const RuntimeEnvironment *renv,const Identity &myIdentity,const Ident
|
||||
Utils::getSecureRandom(&_freeRandomByte, 1);
|
||||
if (!myIdentity.agree(peerIdentity,_key,ZT_PEER_SECRET_KEY_LENGTH))
|
||||
throw ZT_EXCEPTION_INVALID_ARGUMENT;
|
||||
#if ZT_PROTO_VERSION >= 10
|
||||
_pathChoiceHist = new RingBuffer<int>(ZT_MULTIPATH_PROPORTION_WIN_SZ);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Peer::received(
|
||||
|
@ -62,7 +62,9 @@ private:
|
||||
public:
|
||||
~Peer() {
|
||||
Utils::burn(_key,sizeof(_key));
|
||||
#if ZT_PROTO_VERSION >= 10
|
||||
delete _pathChoiceHist;
|
||||
#endif
|
||||
_pathChoiceHist = NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user