1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 05:46:37 +02:00

Cleaned up the dns engine, and fixed sometimes parsing multiple answer queries incorrectly

This commit is contained in:
Adam
2011-08-23 19:06:15 -04:00
parent d5749c11f3
commit b504791bad
4 changed files with 537 additions and 451 deletions
+2 -2
View File
@@ -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);
}
/*************************************************************************/