diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-22 15:18:16 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-22 15:18:16 +0000 |
commit | 70f589ea40d548d344596b91b001448d17ae160f (patch) | |
tree | 871124092eb73c2b2f8c171ac6d2d6f2f9882fc0 | |
parent | 99cb131e9ce0aee782f00042bab9afc5f70fd39f (diff) |
Call OnError when timing out
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5520 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/dns.h | 3 | ||||
-rw-r--r-- | src/dns.cpp | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/include/dns.h b/include/dns.h index 6c690dc87..804250c15 100644 --- a/include/dns.h +++ b/include/dns.h @@ -68,7 +68,8 @@ enum ResolverError RESOLVER_NSDOWN = 1, RESOLVER_NXDOMAIN = 2, RESOLVER_NOTREADY = 3, - RESOLVER_BADIP = 4 + RESOLVER_BADIP = 4, + RESOLVER_TIMEOUT = 5 }; /** diff --git a/src/dns.cpp b/src/dns.cpp index 55c41eb32..ca08b93ba 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -116,7 +116,7 @@ class RequestTimeout : public InspTimer public: RequestTimeout(InspIRCd* SI, DNSRequest* watching, int id, requestlist &requests) : InspTimer(2, time(NULL)), ServerInstance(SI), watch(watching), watchid(id), rl(requests) { - ServerInstance->Log(DEBUG,"New DNS timeout set on %08x", watching); + ServerInstance->Log(DEBUG, "New DNS timeout set on %08x", watching); } void Tick(time_t TIME) @@ -126,13 +126,14 @@ class RequestTimeout : public InspTimer /* Still exists, whack it */ if (rl.find(watchid)->second == watch) { + watch->OnError(RESOLVER_TIMEOUT, "Request timed out"); rl.erase(rl.find(watchid)); delete watch; - ServerInstance->Log(DEBUG,"DNS timeout on %08x squished pointer", watch); + ServerInstance->Log(DEBUG, "DNS timeout on %08x squished pointer", watch); } return; } - ServerInstance->Log(DEBUG,"DNS timeout on %08x: result already received!", watch); + ServerInstance->Log(DEBUG, "DNS timeout on %08x: result already received!", watch); } }; |