diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-23 15:53:53 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-23 15:53:53 -0800 |
| commit | 27f1155f1b2e7bbd61336837498d098b9e4f4a8d (patch) | |
| tree | cdd311e3d2982d156595b8f5c352cfbac31544d1 /service/OneService.cpp | |
| parent | 84732fcb12d66708e7887fba51413cbe629d86d3 (diff) | |
| download | infinitytier-27f1155f1b2e7bbd61336837498d098b9e4f4a8d.tar.gz infinitytier-27f1155f1b2e7bbd61336837498d098b9e4f4a8d.zip | |
docs and API stuff
Diffstat (limited to 'service/OneService.cpp')
| -rw-r--r-- | service/OneService.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/service/OneService.cpp b/service/OneService.cpp index a2024e52..6cfaeb0e 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -1179,7 +1179,8 @@ public: if ((nstr.length() == ZT_ADDRESS_LENGTH_HEX)&&(v.value().is_object())) { const Address ztaddr(nstr.c_str()); if (ztaddr) { - _node->setRole(ztaddr.toInt(),(_jS(v.value()["role"],"") == "upstream") ? ZT_PEER_ROLE_UPSTREAM : ZT_PEER_ROLE_LEAF); + const std::string rstr(_jS(v.value()["role"],"")); + _node->setRole(ztaddr.toInt(),((rstr == "upstream")||(rstr == "UPSTREAM")) ? ZT_PEER_ROLE_UPSTREAM : ZT_PEER_ROLE_LEAF); const uint64_t ztaddr2 = ztaddr.toInt(); std::vector<InetAddress> &v4h = _v4Hints[ztaddr2]; @@ -1239,9 +1240,9 @@ public: json &settings = _localConfig["settings"]; if (settings.is_object()) { const std::string rp(_jS(settings["relayPolicy"],"")); - if (rp == "always") + if ((rp == "always")||(rp == "ALWAYS")) _node->setRelayPolicy(ZT_RELAY_POLICY_ALWAYS); - else if (rp == "never") + else if ((rp == "never")||(rp == "NEVER")) _node->setRelayPolicy(ZT_RELAY_POLICY_NEVER); else _node->setRelayPolicy(ZT_RELAY_POLICY_TRUSTED); } |
