mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-05-29 05:24:18 +00:00
JSON fix
This commit is contained in:
parent
795b6d13d1
commit
7d89511fda
@ -736,8 +736,13 @@ int main(int argc,char **argv)
|
||||
std::ostringstream o;
|
||||
o << '[';
|
||||
{
|
||||
bool first = true;
|
||||
std::lock_guard<std::mutex> l(peersByIdentity_l);
|
||||
for(auto p=peersByIdentity.begin();p!=peersByIdentity.end();++p) {
|
||||
if (first) {
|
||||
first = false;
|
||||
o << ',';
|
||||
}
|
||||
o <<
|
||||
"{\"address\":\"" << p->first.address().toString(tmp) << "\""
|
||||
",\"latency\":-1"
|
||||
@ -753,6 +758,8 @@ int main(int argc,char **argv)
|
||||
",\"trustedPathId\":0}";
|
||||
}
|
||||
if (p->second->ip6) {
|
||||
if (p->second->ip4)
|
||||
o << ',';
|
||||
o <<
|
||||
"{\"active\":true"
|
||||
",\"address\":\"" << p->second->ip6.toIpString(tmp) << "\\/" << p->second->ip6.port() << "\""
|
||||
|
Loading…
x
Reference in New Issue
Block a user