mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-05-31 22:40:48 +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;
|
std::ostringstream o;
|
||||||
o << '[';
|
o << '[';
|
||||||
{
|
{
|
||||||
|
bool first = true;
|
||||||
std::lock_guard<std::mutex> l(peersByIdentity_l);
|
std::lock_guard<std::mutex> l(peersByIdentity_l);
|
||||||
for(auto p=peersByIdentity.begin();p!=peersByIdentity.end();++p) {
|
for(auto p=peersByIdentity.begin();p!=peersByIdentity.end();++p) {
|
||||||
|
if (first) {
|
||||||
|
first = false;
|
||||||
|
o << ',';
|
||||||
|
}
|
||||||
o <<
|
o <<
|
||||||
"{\"address\":\"" << p->first.address().toString(tmp) << "\""
|
"{\"address\":\"" << p->first.address().toString(tmp) << "\""
|
||||||
",\"latency\":-1"
|
",\"latency\":-1"
|
||||||
@ -753,6 +758,8 @@ int main(int argc,char **argv)
|
|||||||
",\"trustedPathId\":0}";
|
",\"trustedPathId\":0}";
|
||||||
}
|
}
|
||||||
if (p->second->ip6) {
|
if (p->second->ip6) {
|
||||||
|
if (p->second->ip4)
|
||||||
|
o << ',';
|
||||||
o <<
|
o <<
|
||||||
"{\"active\":true"
|
"{\"active\":true"
|
||||||
",\"address\":\"" << p->second->ip6.toIpString(tmp) << "\\/" << p->second->ip6.port() << "\""
|
",\"address\":\"" << p->second->ip6.toIpString(tmp) << "\\/" << p->second->ip6.port() << "\""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user