diff options
| author | Grant Limberg <grant.limberg@zerotier.com> | 2017-09-22 10:22:22 -0700 |
|---|---|---|
| committer | Grant Limberg <grant.limberg@zerotier.com> | 2017-09-22 10:22:22 -0700 |
| commit | eb42ef68eeb7a19a9b841cd9f3fe67ffb999c827 (patch) | |
| tree | 9665109ab82fffdfb34ebb90e9d5759cf1dfdd3a /controller/JSONDB.hpp | |
| parent | 6842490c1feb572936d8b3893f6d3d07e289a878 (diff) | |
| parent | 52916eebcfae2559966d12d4be4b5376289a982d (diff) | |
| download | infinitytier-eb42ef68eeb7a19a9b841cd9f3fe67ffb999c827.tar.gz infinitytier-eb42ef68eeb7a19a9b841cd9f3fe67ffb999c827.zip | |
Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev
Diffstat (limited to 'controller/JSONDB.hpp')
| -rw-r--r-- | controller/JSONDB.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/controller/JSONDB.hpp b/controller/JSONDB.hpp index 7131b0c1..44f4d7f5 100644 --- a/controller/JSONDB.hpp +++ b/controller/JSONDB.hpp @@ -37,11 +37,12 @@ #include "../node/Mutex.hpp" #include "../ext/json/json.hpp" #include "../osdep/OSUtils.hpp" -#include "../osdep/Http.hpp" #include "../osdep/Thread.hpp" namespace ZeroTier { +class EmbeddedNetworkController; + /** * Hierarchical JSON store that persists into the filesystem or via HTTP */ @@ -59,7 +60,7 @@ public: uint64_t mostRecentDeauthTime; }; - JSONDB(const std::string &basePath); + JSONDB(const std::string &basePath,EmbeddedNetworkController *parent); ~JSONDB(); /** @@ -156,13 +157,13 @@ public: throw(); private: - bool _add(const nlohmann::json &j); + bool _addOrUpdate(const nlohmann::json &j); bool _load(const std::string &p); void _recomputeSummaryInfo(const uint64_t networkId); std::string _genPath(const std::string &n,bool create); + EmbeddedNetworkController *const _parent; std::string _basePath; - InetAddress _httpAddr; int _rawInput,_rawOutput; Mutex _rawLock; |
