1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 15:53:55 +00:00

Updated control channel to write DNS cache entry for meshcore tunnel

This commit is contained in:
Bryan Roe
2020-06-26 14:51:05 -07:00
parent e289d5f4b2
commit 5308242a52

View File

@@ -3307,6 +3307,11 @@ void MeshServer_ConnectEx(MeshAgentHostContainer *agent)
ILibSimpleDataStore_PutEx(agent->masterDb, serverUrl, serverUrlLen, (char*)&meshServer, ILibInet_StructSize(&meshServer));
}
}
// Update the DNS entry in the db. (It only updates if it changed)
len=sprintf_s(ILibScratchPad, sizeof(ILibScratchPad), "DNS[%s]", host);
char *tmp = ILibRemoteLogging_ConvertAddress((struct sockaddr*)&meshServer);
ILibSimpleDataStore_PutEx(agent->masterDb, ILibScratchPad, len,tmp , (int)strnlen_s(tmp, sizeof(ILibScratchPad)));
}
ILibRemoteLogging_printf(ILibChainGetLogger(agent->chain), ILibRemoteLogging_Modules_Agent_GuardPost, ILibRemoteLogging_Flags_VerbosityLevel_1, "AgentCore: Attempting connection to: %s", serverUrl);