diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-04 15:18:31 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-04 15:18:31 -0700 |
commit | b03c7b2f30b18cc2d243bd226612d911f158bdc4 (patch) | |
tree | e8a821077cf7e2ce871704dfc903e6048e3fb2bd /controller/EmbeddedNetworkController.hpp | |
parent | ab2ccb094aa2b122876668cccb13f755d56c208b (diff) | |
download | infinitytier-b03c7b2f30b18cc2d243bd226612d911f158bdc4.tar.gz infinitytier-b03c7b2f30b18cc2d243bd226612d911f158bdc4.zip |
Refactor controller to use split-out DB for better performance and less ugly.
Diffstat (limited to 'controller/EmbeddedNetworkController.hpp')
-rw-r--r-- | controller/EmbeddedNetworkController.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/controller/EmbeddedNetworkController.hpp b/controller/EmbeddedNetworkController.hpp index 99e1836d..f364c078 100644 --- a/controller/EmbeddedNetworkController.hpp +++ b/controller/EmbeddedNetworkController.hpp @@ -40,6 +40,8 @@ #include "../ext/json/json.hpp" +#include "JSONDB.hpp" + namespace ZeroTier { class Node; @@ -50,10 +52,6 @@ public: EmbeddedNetworkController(Node *node,const char *dbPath); virtual ~EmbeddedNetworkController(); - // Thread main method -- do not call directly - void threadMain() - throw(); - virtual NetworkController::ResultCode doNetworkConfigRequest( const InetAddress &fromAddr, const Identity &signingId, @@ -88,6 +86,7 @@ private: static void _circuitTestCallback(ZT_Node *node,ZT_CircuitTest *test,const ZT_CircuitTestReport *report); // Network base path and network JSON path + /* inline std::string _networkBP(const uint64_t nwid,bool create) { char tmp[64]; @@ -124,6 +123,10 @@ private: // In-memory cache of network members std::map< uint64_t,std::map< Address,nlohmann::json > > _networkMemberCache; Mutex _networkMemberCache_m; + */ + + JSONDB _db; + Mutex _db_m; // Gathers a bunch of statistics about members of a network, IP assignments, etc. that we need in various places // This does lock _networkMemberCache_m @@ -203,9 +206,6 @@ private: // Last request time by address, for rate limitation std::map< std::pair<uint64_t,uint64_t>,uint64_t > _lastRequestTime; Mutex _lastRequestTime_m; - - Thread _daemon; - volatile bool _daemonRun; }; } // namespace ZeroTier |