From 4a733c93d45e0ca5d757abf826d65bc1cbaf610e Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 25 Apr 2011 04:17:21 -0400 Subject: Don't attempt to connect to the uplink if given invalid hostnames --- src/dns.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/dns.cpp') diff --git a/src/dns.cpp b/src/dns.cpp index e5a2c3098..45b3db6bd 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -221,6 +221,11 @@ inline DNSRecord::DNSRecord(const Anope::string &n) : name(n) this->created = Anope::CurTime; } +DNSRecord::operator bool() const +{ + return !this->result.empty(); +} + DNSSocket::DNSSocket() : ConnectionSocket(false, SOCK_DGRAM) { } @@ -613,7 +618,6 @@ DNSRecord DNSManager::BlockingQuery(const Anope::string &mask, QueryType qt) DNSRecord result(mask); addrinfo *addrresult, hints; - result.result = mask; result.type = qt; int type = AF_UNSPEC; -- cgit