From 280f52aeae72a3383e1e10b2f2a5952e7b1413b7 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 12 Dec 2005 12:44:43 +0000 Subject: *EXPERIMENTAL* Tied DNS into new socket engine git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2331 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/dns.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/dns.cpp') diff --git a/src/dns.cpp b/src/dns.cpp index 88b5d399c..a0e36e600 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -37,6 +37,9 @@ using namespace std; #include #include "dns.h" #include "helperfuncs.h" +#include "socketengine.h" + +extern SocketEngine* SE; extern int statsAccept,statsRefused,statsUnknown,statsCollisions,statsDns,statsDnsGood,statsDnsBad,statsConnects,statsSent,statsRecv; @@ -664,6 +667,9 @@ bool DNS::ReverseLookup(std::string ip) return false; } log(DEBUG,"DNS: ReverseLookup, fd=%d",this->myfd); +#ifndef THREADED_DNS + SE->AddFd(this->myfd,true,X_ESTAB_DNS); +#endif return true; } @@ -676,6 +682,9 @@ bool DNS::ForwardLookup(std::string host) return false; } log(DEBUG,"DNS: ForwardLookup, fd=%d",this->myfd); +#ifndef THREADED_DNS + SE->AddFd(this->myfd,true,X_ESTAB_DNS); +#endif return true; } @@ -699,6 +708,9 @@ std::string DNS::GetResult() { log(DEBUG,"DNS: GetResult()"); result = dns_getresult(this->myfd); +#ifndef THREADED_DNS + SE->DelFd(this->myfd); +#endif if (result) { statsDnsGood++; dns_close(this->myfd); @@ -720,6 +732,9 @@ std::string DNS::GetResultIP() result = dns_getresult(this->myfd); if (this->myfd != -1) { +#ifndef THREADED_DNS + SE->DelFd(this->myfd); +#endif dns_close(this->myfd); } if (result) -- cgit v1.3.1-10-gc9f91