From b1ddba0438bc3b33ebc0e28ac5c015fa63be1430 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Mon, 24 Aug 2020 18:56:49 -0700 Subject: [PATCH] Remove a few old comments --- node/Bond.hpp | 4 +++- service/OneService.cpp | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/node/Bond.hpp b/node/Bond.hpp index c8a89b616..b655f47ae 100644 --- a/node/Bond.hpp +++ b/node/Bond.hpp @@ -87,7 +87,9 @@ public: std::string policyAlias() { return _policyAlias; } /** - * Inform the bond about the path that its peer (owning object) just learned about + * Inform the bond about the path that its peer (owning object) just learned about. + * If the path is allowed to be used, it will be inducted into the bond on a trial + * period where link statistics will be collected to judge its quality. * * @param path Newly-learned Path which should now be handled by the Bond * @param now Current time diff --git a/service/OneService.cpp b/service/OneService.cpp index 076dbb59d..1c5dbc3f7 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -1630,7 +1630,6 @@ public: // Custom Policies json &customBondingPolicies = settings["policies"]; for (json::iterator policyItr = customBondingPolicies.begin(); policyItr != customBondingPolicies.end();++policyItr) { - //fprintf(stderr, "\n\n--- (%s)\n", policyItr.key().c_str()); // Custom Policy std::string customPolicyStr(policyItr.key()); json &customPolicy = policyItr.value(); @@ -1684,7 +1683,6 @@ public: // Policy-Specific link set json &links = customPolicy["links"]; for (json::iterator linkItr = links.begin(); linkItr != links.end();++linkItr) { - //fprintf(stderr, "\t--- link (%s)\n", linkItr.key().c_str()); std::string linkNameStr(linkItr.key()); json &link = linkItr.value(); @@ -1719,12 +1717,19 @@ public: } _node->bondController()->addCustomLink(customPolicyStr, new Link(linkNameStr,ipvPref,speed,linkMonitorInterval,upDelay,downDelay,enabled,linkMode,failoverToStr,alloc)); } - // TODO: This is dumb std::string linkSelectMethodStr(OSUtils::jsonString(customPolicy["activeReselect"],"optimize")); - if (linkSelectMethodStr == "always") { newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_ALWAYS); } - if (linkSelectMethodStr == "better") { newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_BETTER); } - if (linkSelectMethodStr == "failure") { newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_FAILURE); } - if (linkSelectMethodStr == "optimize") { newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_OPTIMIZE); } + if (linkSelectMethodStr == "always") { + newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_ALWAYS); + } + if (linkSelectMethodStr == "better") { + newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_BETTER); + } + if (linkSelectMethodStr == "failure") { + newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_FAILURE); + } + if (linkSelectMethodStr == "optimize") { + newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_OPTIMIZE); + } if (newTemplateBond->getLinkSelectMethod() < 0 || newTemplateBond->getLinkSelectMethod() > 3) { fprintf(stderr, "warning: invalid value (%s) for linkSelectMethod, assuming mode: always\n", linkSelectMethodStr.c_str()); }