mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-18 20:47:53 +00:00
clean up some debug logging
This commit is contained in:
parent
137d05e799
commit
30b18d925f
@ -9,8 +9,6 @@ namespace ZeroTier {
|
||||
class MacDNSHelper
|
||||
{
|
||||
public:
|
||||
static void doTheThing();
|
||||
|
||||
static void setDNS(uint64_t nwid, const char *domain, const std::vector<InetAddress> &servers);
|
||||
static void removeDNS(uint64_t nwid);
|
||||
};
|
||||
|
@ -6,11 +6,6 @@
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
void MacDNSHelper::doTheThing()
|
||||
{
|
||||
fprintf(stderr, "\n\nDOING THE THING!!\n\n");
|
||||
}
|
||||
|
||||
void MacDNSHelper::setDNS(uint64_t nwid, const char *domain, const std::vector<InetAddress> &servers)
|
||||
{
|
||||
SCDynamicStoreRef ds = SCDynamicStoreCreate(NULL, CFSTR("zerotier"), NULL, NULL);
|
||||
@ -49,15 +44,11 @@ void MacDNSHelper::setDNS(uint64_t nwid, const char *domain, const std::vector<I
|
||||
CFIndex i = 0, j = CFArrayGetCount(list);
|
||||
bool ret = TRUE;
|
||||
if (j <= 0) {
|
||||
fprintf(stderr, "Key '%s' does not exist. Creating.\n", buf);
|
||||
ret &= SCDynamicStoreAddValue(ds, key, dict);
|
||||
} else {
|
||||
fprintf(stderr, "Key '%s' already exists. Updating DNS config.\n", buf);
|
||||
ret &= SCDynamicStoreSetValue(ds, (CFStringRef)CFArrayGetValueAtIndex(list, i), dict);
|
||||
}
|
||||
if (ret) {
|
||||
fprintf(stderr, "DNS written successfully\n");
|
||||
} else {
|
||||
if (!ret) {
|
||||
fprintf(stderr, "Error writing DNS configuration\n");
|
||||
}
|
||||
|
||||
|
@ -458,7 +458,6 @@ void MacEthernetTap::threadMain()
|
||||
|
||||
void MacEthernetTap::setDns(const char *domain, const std::vector<InetAddress> &servers)
|
||||
{
|
||||
MacDNSHelper::doTheThing();
|
||||
MacDNSHelper::setDNS(this->_nwid, domain, servers);
|
||||
}
|
||||
|
||||
|
@ -36,11 +36,9 @@ BOOL RegDelnodeRecurse(HKEY hKeyRoot, LPTSTR lpSubKey)
|
||||
if (lResult != ERROR_SUCCESS)
|
||||
{
|
||||
if (lResult == ERROR_FILE_NOT_FOUND) {
|
||||
printf("Key not found.\n");
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
printf("Error opening key.\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -160,7 +158,6 @@ std::vector<std::string> getSubKeys(const char* key)
|
||||
&cbSecurityDescriptor, // security descriptor
|
||||
&ftLastWriteTime); // last write time
|
||||
|
||||
fprintf(stderr, "num subkeys: %d\n", cSubKeys);
|
||||
for (i = 0; i < cSubKeys; ++i) {
|
||||
cbName = MAX_KEY_LENGTH;
|
||||
retCode = RegEnumKeyEx(
|
||||
@ -222,7 +219,6 @@ std::vector<std::string> getValueList(const char* key) {
|
||||
&cbSecurityDescriptor, // security descriptor
|
||||
&ftLastWriteTime); // last write time
|
||||
|
||||
fprintf(stderr, "Num values: %d\n", cValues);
|
||||
for (i = 0, retCode = ERROR_SUCCESS; i < cValues; ++i) {
|
||||
cchValue = MAX_VALUE_NAME;
|
||||
achValue[0] = '\0';
|
||||
@ -254,10 +250,8 @@ std::pair<bool, std::string> WinDNSHelper::hasDNSConfig(uint64_t nwid)
|
||||
for (auto it = subkeys.begin(); it != subkeys.end(); ++it) {
|
||||
char sub[MAX_KEY_LENGTH] = { 0 };
|
||||
sprintf(sub, "%s\\%s", baseKey, it->c_str());
|
||||
fprintf(stderr, "Checking key: %s\n", sub);
|
||||
auto dnsRecords = getValueList(sub);
|
||||
for (auto it2 = dnsRecords.begin(); it2 != dnsRecords.end(); ++it2) {
|
||||
fprintf(stderr, "\t%s\n", it2->c_str());
|
||||
if ((*it2) == "Comment") {
|
||||
HKEY hKey;
|
||||
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
|
||||
|
Loading…
Reference in New Issue
Block a user