1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 19:26:40 +02:00

Don't attempt to connect to the uplink if given invalid hostnames

This commit is contained in:
Adam
2011-04-25 04:17:21 -04:00
parent 03d2378a9f
commit 4a733c93d4
5 changed files with 46 additions and 18 deletions
+7 -1
View File
@@ -369,6 +369,12 @@ static bool Connect()
DNSRecord req = DNSManager::BlockingQuery(uplink_server->host, uplink_server->ipv6 ? DNS_QUERY_AAAA : DNS_QUERY_A);
if (!req)
{
Log() << "Unable to connect to server " << servernum << " (" << uplink_server->host << ":" << uplink_server->port << "): Invalid hostname/IP";
continue;
}
try
{
new UplinkSocket(uplink_server->ipv6);
@@ -376,7 +382,7 @@ static bool Connect()
}
catch (const SocketException &ex)
{
Log() << "Unable to connect to server" << servernum << " (" << uplink_server->host << ":" << uplink_server->port << "), " << ex.GetReason();
Log() << "Unable to connect to server " << servernum << " (" << uplink_server->host << ":" << uplink_server->port << "): " << ex.GetReason();
continue;
}