From f1ca6c6d71f3e31b333e0be45294bcb30fd89b4d Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 7 Jan 2007 21:35:25 +0000 Subject: DNS caching stuff (almost done) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6252 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 37664a629..a42e86210 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -153,10 +153,7 @@ void userrec::StartDNSLookup() ServerInstance->Log(DEBUG,"Passing instance: %08x",this->ServerInstance); bool cached; res_reverse = new UserResolver(this->ServerInstance, this, this->GetIPString(), DNS_QUERY_REVERSE, cached); - if (!cached) - this->ServerInstance->AddResolver(res_reverse); - else - delete res_reverse; + this->ServerInstance->AddResolver(res_reverse, cached); } catch (CoreException& e) { @@ -189,10 +186,7 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl) #else bound_user->res_forward = new UserResolver(this->ServerInstance, this->bound_user, result, DNS_QUERY_A, cached); #endif - if (!cached) - this->ServerInstance->AddResolver(bound_user->res_forward); - else - delete bound_user->res_forward; + this->ServerInstance->AddResolver(bound_user->res_forward, cached); } } catch (CoreException& e) -- cgit v1.3.1-10-gc9f91