+ ServerInstance->stats->statsDnsBad++;
+ if (this->myfd != -1)
+ {
+ dns_close(this->myfd);
+ }
+ return "";
+ }
+}
+
+std::string DNS::GetResultIP()
+{
+ char r[1024];
+ log(DEBUG,"DNS: GetResultIP()");
+ result = dns_getresult(this->myfd);
+ if (this->myfd != -1)
+ {
+#ifndef THREADED_DNS
+ ServerInstance->SE->DelFd(this->myfd);
+#endif
+ dns_close(this->myfd);
+ }
+ if (result)
+ {
+ ServerInstance->stats->statsDnsGood++;
+ unsigned char a = (unsigned)result[0];
+ unsigned char b = (unsigned)result[1];
+ unsigned char c = (unsigned)result[2];
+ unsigned char d = (unsigned)result[3];
+ snprintf(r,1024,"%u.%u.%u.%u",a,b,c,d);
+ return r;
+ }
+ else
+ {
+ ServerInstance->stats->statsDnsBad++;
+ log(DEBUG,"DANGER WILL ROBINSON! NXDOMAIN for forward lookup, but we got a reverse lookup!");