]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dns.cpp
Decide that it wasn't quite appropriate :(
[user/henk/code/inspircd.git] / src / dns.cpp
index d4fe1398b0d023131a6a0f471a1e90d9dad8b715..3b8f8cc95426a7cf23febdb329b3aa384b5d9505 100644 (file)
@@ -735,6 +735,20 @@ bool DNS::ForwardLookup(std::string host)
        return true;
 }
 
+bool DNS::ForwardLookupWithFD(std::string host, int &fd)
+{
+       ServerInstance->stats->statsDns++;
+       this->myfd = dns_getip4(host.c_str());
+       fd = this->myfd;
+       if (this->myfd == -1)
+       {
+               
+       }
+       log(DEBUG,"DNS: ForwardLookupWithFD, fd=%d",this->myfd);
+       ServerInstance->SE->AddFd(this->myfd,true,X_ESTAB_MODULE);
+       return true;
+}
+
 bool DNS::HasResult(int fd)
 {
        return (fd == this->myfd);
@@ -819,7 +833,7 @@ void* dns_task(void* arg)
         DNS dns2;
         std::string host;
         std::string ip;
-        if (dns1.ReverseLookup(u->ip))
+        if (dns1.ReverseLookup((char*)inet_ntoa(u->ip4)))
         {
                 while (!dns1.HasResult())
                 {
@@ -835,7 +849,7 @@ void* dns_task(void* arg)
                                         usleep(100);
                                 }
                                 ip = dns2.GetResultIP();
-                                if (ip == std::string(u->ip))
+                                if (ip == std::string((char*)inet_ntoa(u->ip4)))
                                 {
                                         if (host.length() < 160)
                                         {