diff options
author | Adam <Adam@anope.org> | 2012-12-15 01:33:31 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-12-15 01:33:31 -0500 |
commit | dcd34d37287adb6aa03d32edd17fc8015b52feb8 (patch) | |
tree | 4eb963bc60c8db543973456e7fce35aaae5a4ad4 /src/uplink.cpp | |
parent | cdec0a3f96bbfa6d5300b7a6d602fd170e7ccd56 (diff) |
Move DNS handling to a module
Diffstat (limited to 'src/uplink.cpp')
-rw-r--r-- | src/uplink.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/uplink.cpp b/src/uplink.cpp index ac77672b2..9490329b3 100644 --- a/src/uplink.cpp +++ b/src/uplink.cpp @@ -15,7 +15,6 @@ #include "config.h" #include "protocol.h" #include "servers.h" -#include "dns.h" UplinkSocket *UplinkSock = NULL; @@ -48,10 +47,9 @@ void Uplink::Connect() if (!Config->LocalHost.empty()) UplinkSock->Bind(Config->LocalHost); FOREACH_MOD(I_OnPreServerConnect, OnPreServerConnect()); - DNS::Query rep = DNS::Manager::BlockingQuery(u->host, u->ipv6 ? DNS::QUERY_AAAA : DNS::QUERY_A); - Anope::string reply_ip = !rep.answers.empty() ? rep.answers.front().rdata : u->host; - Log(LOG_TERMINAL) << "Attempting to connect to uplink #" << (Anope::CurrentUplink + 1) << " " << u->host << " (" << reply_ip << "), port " << u->port; - UplinkSock->Connect(reply_ip, u->port); + Anope::string ip = Anope::Resolve(u->host, u->ipv6 ? AF_INET6 : AF_INET); + Log(LOG_TERMINAL) << "Attempting to connect to uplink #" << (Anope::CurrentUplink + 1) << " " << u->host << " (" << ip << "), port " << u->port; + UplinkSock->Connect(ip, u->port); } |