Added --no-dns command line parameter

This commit is contained in:
SChernykh
2022-09-04 18:10:14 +02:00
parent c49e8d4770
commit e4dd46b498
8 changed files with 38 additions and 11 deletions

View File

@@ -353,8 +353,15 @@ static thread_local bool main_thread = false;
void set_main_thread() { main_thread = true; }
bool is_main_thread() { return main_thread; }
bool disable_resolve_host = false;
bool resolve_host(std::string& host, bool& is_v6)
{
if (disable_resolve_host) {
LOGERR(1, "resolve_host was called with DNS disabled for host " << host);
return false;
}
addrinfo hints{};
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;