diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-07-17 17:02:50 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-07-17 17:02:50 -0700 |
commit | 1685659e37f568c727580634e412674cc266ff31 (patch) | |
tree | b0dd1b55d5ffe276da5d7acbd1b04bc0e42118c2 /controller | |
parent | 5e2ea4a81ae95a488e30f6f0e20a37d38bbeea64 (diff) | |
download | infinitytier-1685659e37f568c727580634e412674cc266ff31.tar.gz infinitytier-1685659e37f568c727580634e412674cc266ff31.zip |
Remote tracing works.
Diffstat (limited to 'controller')
-rw-r--r-- | controller/EmbeddedNetworkController.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index c2024962..07ab5168 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -1089,7 +1089,9 @@ void EmbeddedNetworkController::handleRemoteTrace(const ZT_RemoteTrace &rt) { try { std::vector<uint64_t> nw4m(_db.networksForMember(rt.origin)); - if (nw4m.empty()) // ignore these for unknown members + + // Ignore remote traces from members we don't know about + if (nw4m.empty()) return; // Convert Dictionary into JSON object @@ -1133,7 +1135,8 @@ void EmbeddedNetworkController::handleRemoteTrace(const ZT_RemoteTrace &rt) } } - bool accept = false; + bool accept = true; + /* for(std::vector<uint64_t>::const_iterator nwid(nw4m.begin());nwid!=nw4m.end();++nwid) { json nconf; if (_db.getNetwork(*nwid,nconf)) { @@ -1153,9 +1156,10 @@ void EmbeddedNetworkController::handleRemoteTrace(const ZT_RemoteTrace &rt) } catch ( ... ) {} // ignore missing fields or other errors, drop trace message } } + */ if (accept) { char p[128]; - OSUtils::ztsnprintf(p,sizeof(p),"trace/%.10llx_%.16llx.json",rt.origin,OSUtils::now()); + OSUtils::ztsnprintf(p,sizeof(p),"trace/%.10llx-%.10llx-%.16llx",_signingId.address().toInt(),rt.origin,OSUtils::now()); _db.writeRaw(p,OSUtils::jsonDump(d)); } } catch ( ... ) { @@ -1419,6 +1423,8 @@ void EmbeddedNetworkController::_request( rtt = OSUtils::jsonString(network["remoteTraceTarget"],""); if (rtt.length() == 10) { nc->remoteTraceTarget = Address(Utils::hexStrToU64(rtt.c_str())); + } else { + nc->remoteTraceTarget = _signingId.address(); } } |