summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2018-01-10 15:03:39 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2018-01-10 15:03:39 -0800
commitf17cc1c6d80657fe8cd98891cf0bb1bbf3ac62bf (patch)
tree24cc4b631b0f162a73cd9138cc50a5c931a5d29c
parent6304c85d3fe81ee6d89584e70e0af0d206f44997 (diff)
downloadinfinitytier-f17cc1c6d80657fe8cd98891cf0bb1bbf3ac62bf.tar.gz
infinitytier-f17cc1c6d80657fe8cd98891cf0bb1bbf3ac62bf.zip
cleanup
-rw-r--r--controller/FileDB.cpp9
-rw-r--r--controller/FileDB.hpp5
-rw-r--r--controller/RethinkDB.hpp4
3 files changed, 6 insertions, 12 deletions
diff --git a/controller/FileDB.cpp b/controller/FileDB.cpp
index 6942a16e..40b9f914 100644
--- a/controller/FileDB.cpp
+++ b/controller/FileDB.cpp
@@ -23,12 +23,13 @@ namespace ZeroTier
FileDB::FileDB(EmbeddedNetworkController *const nc,const Identity &myId,const char *path) :
DB(nc,myId,path),
- _networksPath(_path + ZT_PATH_SEPARATOR_S + "network")
+ _networksPath(_path + ZT_PATH_SEPARATOR_S + "network"),
+ _tracePath(_path + ZT_PATH_SEPARATOR_S + "trace")
{
OSUtils::mkdir(_path.c_str());
OSUtils::lockDownFile(_path.c_str(),true);
- OSUtils::mkdir((_path + ZT_PATH_SEPARATOR + "network").c_str());
- OSUtils::mkdir((_path + ZT_PATH_SEPARATOR + "trace").c_str());
+ OSUtils::mkdir(_networksPath.c_str());
+ OSUtils::mkdir(_tracePath.c_str());
std::vector<std::string> networks(OSUtils::listDirectory(_networksPath.c_str(),false));
std::string buf;
@@ -120,7 +121,7 @@ void FileDB::save(nlohmann::json *orig,nlohmann::json &record)
} else if (objtype == "trace") {
const std::string id = record["id"];
if (id.length() > 0) {
- OSUtils::ztsnprintf(p1,sizeof(p1),"%s" ZT_PATH_SEPARATOR_S "trace" ZT_PATH_SEPARATOR_S "%s.json",_path.c_str(),id.c_str());
+ OSUtils::ztsnprintf(p1,sizeof(p1),"%s" ZT_PATH_SEPARATOR_S "%s.json",_tracePath.c_str(),id.c_str());
OSUtils::writeFile(p1,OSUtils::jsonDump(record,-1));
}
}
diff --git a/controller/FileDB.hpp b/controller/FileDB.hpp
index eeb1c541..b02da8cb 100644
--- a/controller/FileDB.hpp
+++ b/controller/FileDB.hpp
@@ -31,17 +31,14 @@ public:
virtual ~FileDB();
virtual bool waitForReady();
-
virtual void save(nlohmann::json *orig,nlohmann::json &record);
-
virtual void eraseNetwork(const uint64_t networkId);
-
virtual void eraseMember(const uint64_t networkId,const uint64_t memberId);
-
virtual void nodeIsOnline(const uint64_t networkId,const uint64_t memberId,const InetAddress &physicalAddress);
protected:
std::string _networksPath;
+ std::string _tracePath;
};
} // namespace ZeroTier
diff --git a/controller/RethinkDB.hpp b/controller/RethinkDB.hpp
index 07f0abfb..bce8bdef 100644
--- a/controller/RethinkDB.hpp
+++ b/controller/RethinkDB.hpp
@@ -41,13 +41,9 @@ public:
virtual ~RethinkDB();
virtual bool waitForReady();
-
virtual void save(nlohmann::json *orig,nlohmann::json &record);
-
virtual void eraseNetwork(const uint64_t networkId);
-
virtual void eraseMember(const uint64_t networkId,const uint64_t memberId);
-
virtual void nodeIsOnline(const uint64_t networkId,const uint64_t memberId,const InetAddress &physicalAddress);
protected: