summaryrefslogtreecommitdiff
path: root/node/RuntimeEnvironment.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-11-05 12:22:58 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-11-05 12:22:58 -0800
commit8ef4edebbfeead53e5b2b454086e21e42e809aab (patch)
tree83ee9e9c362dd31f4225e99a67f52d9538d3ae6e /node/RuntimeEnvironment.hpp
parenta95ff21aafa793e5282f32b77b893da3f42a4a57 (diff)
downloadinfinitytier-8ef4edebbfeead53e5b2b454086e21e42e809aab.tar.gz
infinitytier-8ef4edebbfeead53e5b2b454086e21e42e809aab.zip
Deferred decode for HELLO to prevent HELLOcalypse under high load of new peers.
Diffstat (limited to 'node/RuntimeEnvironment.hpp')
-rw-r--r--node/RuntimeEnvironment.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/node/RuntimeEnvironment.hpp b/node/RuntimeEnvironment.hpp
index 2ec88f72..18d9e8e5 100644
--- a/node/RuntimeEnvironment.hpp
+++ b/node/RuntimeEnvironment.hpp
@@ -32,6 +32,7 @@
#include "Constants.hpp"
#include "Identity.hpp"
+#include "Mutex.hpp"
namespace ZeroTier {
@@ -44,6 +45,7 @@ class AntiRecursion;
class NetworkController;
class SelfAwareness;
class Cluster;
+class DeferredPackets;
/**
* Holds global state for an instance of ZeroTier::Node
@@ -55,6 +57,7 @@ public:
node(n)
,identity()
,localNetworkController((NetworkController *)0)
+ ,dp((DeferredPackets *)0)
,sw((Switch *)0)
,mc((Multicaster *)0)
,antiRec((AntiRecursion *)0)
@@ -77,6 +80,10 @@ public:
// This is set externally to an instance of this base class
NetworkController *localNetworkController;
+ // This is created if background threads call Node::backgroundThreadMain().
+ DeferredPackets *volatile dp; // can be read without lock but not written
+ Mutex dpSetLock;
+
/*
* Order matters a bit here. These are constructed in this order
* and then deleted in the opposite order on Node exit. The order ensures