diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-10-28 14:17:39 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-10-28 14:17:39 -0700 |
| commit | 3d85a615fb9a50e193eac5320522be409408a3c3 (patch) | |
| tree | 5c5fbce351cca376d78cf5f0d439345e8d92d262 /testnet.cpp | |
| parent | f873881a0ddf2043758b3e7925c95168600f42da (diff) | |
| download | infinitytier-3d85a615fb9a50e193eac5320522be409408a3c3.tar.gz infinitytier-3d85a615fb9a50e193eac5320522be409408a3c3.zip | |
NULL dereference on still-initializing node bug fix in status query commands, and doc updates.
Diffstat (limited to 'testnet.cpp')
| -rw-r--r-- | testnet.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/testnet.cpp b/testnet.cpp index 605d8945..b6f6572b 100644 --- a/testnet.cpp +++ b/testnet.cpp @@ -278,12 +278,14 @@ static void doList(const std::vector<std::string> &cmd) ZT1_Node_Status status; for(std::map< Address,SimNode * >::iterator n(nodes.begin());n!=nodes.end();++n) { n->second->node.status(&status); - printf("%s %c %s (%u peers, %u direct links)"ZT_EOL_S, - n->first.toString().c_str(), - n->second->supernode ? 'S' : 'N', - (status.online ? "ONLINE" : "OFFLINE"), - status.knownPeers, - status.directlyConnectedPeers); + if (status.initialized) { + printf("%s %c %s (%u peers, %u direct links)"ZT_EOL_S, + n->first.toString().c_str(), + n->second->supernode ? 'S' : 'N', + (status.online ? "ONLINE" : "OFFLINE"), + status.knownPeers, + status.directlyConnectedPeers); + } else printf("%s ? INITIALIZING (0 peers, 0 direct links)"ZT_EOL_S,n->first.toString().c_str()); } } @@ -571,6 +573,8 @@ static void doUnicast(const std::vector<std::string> &cmd) } } } + + printf("---------- sent %u, received %u"ZT_EOL_S,(unsigned int)sentPairs.size(),(unsigned int)receivedPairs.size()); } int main(int argc,char **argv) |
