mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-03-22 03:55:24 +00:00
More debug logging cleanup
This commit is contained in:
parent
30b18d925f
commit
058d888311
@ -112,7 +112,6 @@ bool DB::get(const uint64_t networkId,nlohmann::json &network)
|
||||
std::lock_guard<std::mutex> l2(nw->lock);
|
||||
network = nw->config;
|
||||
}
|
||||
fprintf(stderr, "DB::get(uint64_t,json): %s %s\n", OSUtils::jsonString(network["nwid"],"").c_str(), OSUtils::jsonDump(network["dns"], 2).c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -135,7 +134,6 @@ bool DB::get(const uint64_t networkId,nlohmann::json &network,const uint64_t mem
|
||||
return false;
|
||||
member = m->second;
|
||||
}
|
||||
fprintf(stderr, "DB::get(uint64_t,json,uint64_t,mjson): %s %s\n", OSUtils::jsonString(network["nwid"],"").c_str(), OSUtils::jsonDump(network["dns"], 2).c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -159,7 +157,6 @@ bool DB::get(const uint64_t networkId,nlohmann::json &network,const uint64_t mem
|
||||
return false;
|
||||
member = m->second;
|
||||
}
|
||||
fprintf(stderr, "DB::get(uint64_t,json,uint64_t,mjson,summary): %s %s\n", OSUtils::jsonString(network["nwid"],"").c_str(), OSUtils::jsonDump(network["dns"], 2).c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -180,7 +177,6 @@ bool DB::get(const uint64_t networkId,nlohmann::json &network,std::vector<nlohma
|
||||
for(auto m=nw->members.begin();m!=nw->members.end();++m)
|
||||
members.push_back(m->second);
|
||||
}
|
||||
fprintf(stderr, "DB::get(uint64_t,json,members): %s %s\n", OSUtils::jsonString(network["nwid"],"").c_str(), OSUtils::jsonDump(network["dns"], 2).c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -311,7 +307,6 @@ void DB::_networkChanged(nlohmann::json &old,nlohmann::json &networkConfig,bool
|
||||
{
|
||||
if (networkConfig.is_object()) {
|
||||
const std::string ids = networkConfig["id"];
|
||||
fprintf(stderr, "DB::_networkChanged(): %s\n", OSUtils::jsonDump(networkConfig["dns"]).c_str());
|
||||
const uint64_t networkId = Utils::hexStrToU64(ids.c_str());
|
||||
if (networkId) {
|
||||
std::shared_ptr<_Network> nw;
|
||||
|
@ -1419,8 +1419,6 @@ void EmbeddedNetworkController::_request(
|
||||
json &memberTags = member["tags"];
|
||||
json &dns = network["dns"];
|
||||
|
||||
fprintf(stderr, "DNS Config for Network ID %.16llx: %s\n", nwid, OSUtils::jsonDump(dns, 2).c_str());
|
||||
|
||||
if (metaData.getUI(ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_RULES_ENGINE_REV,0) <= 0) {
|
||||
// Old versions with no rules engine support get an allow everything rule.
|
||||
// Since rules are enforced bidirectionally, newer versions *will* still
|
||||
@ -1714,11 +1712,9 @@ void EmbeddedNetworkController::_request(
|
||||
}
|
||||
|
||||
if(dns.is_array()) {
|
||||
fprintf(stderr, "dns is array of size %d\n", dns.size());
|
||||
nc->dnsCount = 0;
|
||||
for(unsigned int p=0; p < dns.size(); ++p) {
|
||||
json &d = dns[p];
|
||||
fprintf(stderr, "%s\n", OSUtils::jsonDump(d, 2).c_str());
|
||||
if (d.is_object()) {
|
||||
std::string domain = OSUtils::jsonString(d["domain"],"");
|
||||
memcpy(nc->dns[nc->dnsCount].domain, domain.c_str(), domain.size());
|
||||
@ -1733,7 +1729,6 @@ void EmbeddedNetworkController::_request(
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "dns is NOT an array\n");
|
||||
dns = json::array();
|
||||
}
|
||||
|
||||
|
@ -456,7 +456,6 @@ void PostgreSQL::initializeNetworks(PGconn *conn)
|
||||
auto servers = json::array();
|
||||
if (serverList.rfind("{",0) != std::string::npos) {
|
||||
serverList = serverList.substr(1, serverList.size()-2);
|
||||
fprintf(stderr, "Server List: %s\n", serverList.c_str());
|
||||
std::stringstream ss(serverList);
|
||||
while(ss.good()) {
|
||||
std::string server;
|
||||
@ -468,7 +467,6 @@ void PostgreSQL::initializeNetworks(PGconn *conn)
|
||||
obj["servers"] = servers;
|
||||
config["dns"].push_back(obj);
|
||||
}
|
||||
fprintf(stderr, "%s: %s\n", OSUtils::jsonString(config["nwid"], "").c_str(), OSUtils::jsonDump(config["dns"], 2).c_str());
|
||||
|
||||
PQclear(r2);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user