mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-05-06 02:28:23 +00:00
Minor bonding CLI fix
This commit is contained in:
parent
5262a2f753
commit
1732f7371c
@ -1830,4 +1830,4 @@ void Bond::dumpInfo(const int64_t now)
|
|||||||
// Omitted
|
// Omitted
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ZeroTier
|
} // namespace ZeroTier
|
||||||
|
@ -747,4 +747,4 @@ private:
|
|||||||
|
|
||||||
} // namespace ZeroTier
|
} // namespace ZeroTier
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -209,4 +209,4 @@ void BondController::processBackgroundTasks(void *tPtr, const int64_t now)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ZeroTier
|
} // namespace ZeroTier
|
||||||
|
@ -236,4 +236,4 @@ private:
|
|||||||
|
|
||||||
} // namespace ZeroTier
|
} // namespace ZeroTier
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
13
one.cpp
13
one.cpp
@ -494,7 +494,7 @@ static int cli(int argc,char **argv)
|
|||||||
} else if (command == "bond") {
|
} else if (command == "bond") {
|
||||||
/* zerotier-cli bond */
|
/* zerotier-cli bond */
|
||||||
if (arg1.empty()) {
|
if (arg1.empty()) {
|
||||||
printf("(bond) command is missing required arugments" ZT_EOL_S);
|
printf("(bond) command is missing required arguments" ZT_EOL_S);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
/* zerotier-cli bond list */
|
/* zerotier-cli bond list */
|
||||||
@ -676,7 +676,7 @@ static int cli(int argc,char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* zerotier-cli bond command was malformed in some way */
|
/* zerotier-cli bond command was malformed in some way */
|
||||||
printf("(bond) command is missing required arugments" ZT_EOL_S);
|
printf("(bond) command is missing required arguments" ZT_EOL_S);
|
||||||
return 2;
|
return 2;
|
||||||
const unsigned int scode = Http::GET(1024 * 1024 * 16,60000,(const struct sockaddr *)&addr,"/bonds",requestHeaders,responseHeaders,responseBody);
|
const unsigned int scode = Http::GET(1024 * 1024 * 16,60000,(const struct sockaddr *)&addr,"/bonds",requestHeaders,responseHeaders,responseBody);
|
||||||
if (scode == 0) {
|
if (scode == 0) {
|
||||||
@ -713,12 +713,13 @@ static int cli(int argc,char **argv)
|
|||||||
nlohmann::json &p = j[k];
|
nlohmann::json &p = j[k];
|
||||||
|
|
||||||
bool isBonded = p["isBonded"];
|
bool isBonded = p["isBonded"];
|
||||||
int8_t bondingPolicy = p["bondingPolicy"];
|
|
||||||
bool isHealthy = p["isHealthy"];
|
|
||||||
int8_t numAliveLinks = p["numAliveLinks"];
|
|
||||||
int8_t numTotalLinks = p["numTotalLinks"];
|
|
||||||
|
|
||||||
if (isBonded) {
|
if (isBonded) {
|
||||||
|
int8_t bondingPolicy = p["bondingPolicy"];
|
||||||
|
bool isHealthy = p["isHealthy"];
|
||||||
|
int8_t numAliveLinks = p["numAliveLinks"];
|
||||||
|
int8_t numTotalLinks = p["numTotalLinks"];
|
||||||
|
|
||||||
bFoundBond = true;
|
bFoundBond = true;
|
||||||
std::string healthStr;
|
std::string healthStr;
|
||||||
if (isHealthy) {
|
if (isHealthy) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user