diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-07 21:35:25 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-07 21:35:25 +0000 |
commit | f1ca6c6d71f3e31b333e0be45294bcb30fd89b4d (patch) | |
tree | 307b67ee46dc6b69b844626051c933711d1d1d0d /src/dns.cpp | |
parent | 8d948ff975c815cb32300354244b1bab263af155 (diff) |
DNS caching stuff (almost done)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6252 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/dns.cpp')
-rw-r--r-- | src/dns.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dns.cpp b/src/dns.cpp index 385f8639e..a8aaa3fde 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -911,9 +911,10 @@ void DNS::DelCache(const std::string &source) cache->erase(source.c_str()); } -void Resolver::OnLookupComplete(const std::string &result, unsigned int ttl) +void Resolver::TriggerCachedResult() { - throw CoreException("Someone didnt define an OnLookupComplete method for their Resolver class!"); + if (CQ) + OnLookupComplete(CQ->data, time_left); } /** High level abstraction of dns used by application at large */ @@ -923,10 +924,10 @@ Resolver::Resolver(InspIRCd* Instance, const std::string &source, QueryType qt, cached = false; - CachedQuery* CQ = ServerInstance->Res->GetCache(source); + CQ = ServerInstance->Res->GetCache(source); if (CQ) { - int time_left = CQ->CalcTTLRemaining(); + time_left = CQ->CalcTTLRemaining(); if (!time_left) { ServerInstance->Log(DEBUG,"Cached but EXPIRED result: %s", CQ->data.c_str()); @@ -936,7 +937,6 @@ Resolver::Resolver(InspIRCd* Instance, const std::string &source, QueryType qt, { cached = true; ServerInstance->Log(DEBUG,"Cached result: %s", CQ->data.c_str()); - OnLookupComplete(CQ->data, time_left); return; } } |