From b504791bad450dfc9d28faa8b2009f8eaef0f485 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 23 Aug 2011 19:06:15 -0400 Subject: Cleaned up the dns engine, and fixed sometimes parsing multiple answer queries incorrectly --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index b00a6ee6e..69a5fe38f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -183,8 +183,8 @@ static void Connect() if (!Config->LocalHost.empty()) UplinkSock->Bind(Config->LocalHost); FOREACH_MOD(I_OnPreServerConnect, OnPreServerConnect()); - DNSRecord req = DNSManager::BlockingQuery(u->host, u->ipv6 ? DNS_QUERY_AAAA : DNS_QUERY_A); - UplinkSock->Connect(req.result, u->port); + DNSQuery rep = DNSManager::BlockingQuery(u->host, u->ipv6 ? DNS_QUERY_AAAA : DNS_QUERY_A); + UplinkSock->Connect(!rep.answers.empty() ? rep.answers.front().rdata : u->host, u->port); } /*************************************************************************/ -- cgit