summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-04-14 15:32:05 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-04-14 15:32:05 -0700
commit347e98dcd2d29772d5b9cf23c307b0a6ce0d8858 (patch)
tree7c03cc6541b5b9d65ab3903a47d971d660f871dd /service
parent29a2175b7a7055ab851f5b921e26c51ffa547d07 (diff)
downloadinfinitytier-347e98dcd2d29772d5b9cf23c307b0a6ce0d8858.tar.gz
infinitytier-347e98dcd2d29772d5b9cf23c307b0a6ce0d8858.zip
Just return files from listDirectory() since that is all we need, fix network request on network restore logic, and remember saved networks in service/One
Diffstat (limited to 'service')
-rw-r--r--service/One.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/service/One.cpp b/service/One.cpp
index 5e81bc61..c4e1b251 100644
--- a/service/One.cpp
+++ b/service/One.cpp
@@ -191,6 +191,15 @@ public:
_controlPlane = new ControlPlane(_node);
+ {
+ std::vector<std::string> networksDotD(OSUtils::listDirectory((_homePath + ZT_PATH_SEPARATOR_S + "networks.d").c_str()));
+ for(std::vector<std::string>::iterator f(networksDotD.begin());f!=networksDotD.end();++f) {
+ std::size_t dot = f->find_last_of('.');
+ if ((dot == 16)&&(f->substr(16) == ".conf"))
+ _node->join(Utils::hexStrToU64(f->substr(0,dot).c_str()));
+ }
+ }
+
_nextBackgroundTaskDeadline = 0;
for(;;) {
_run_m.lock();