summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-05-13 00:43:00 +0200
committerAttila Molnar <attilamolnar@hush.com>2015-05-13 00:43:00 +0200
commitc090e54be9c01f862a734ad31a3e6c01ff259d3a (patch)
treec425a3e924bed4bca9fd4827d27622966840f1a2
parentd1f028db2be42a272b142511bc006a42bb27af8d (diff)
core_dns Add DNS timeout timer in Process() not in DNS::Request constructor
-rw-r--r--include/modules/dns.h1
-rw-r--r--src/coremods/core_dns.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/include/modules/dns.h b/include/modules/dns.h
index ea443e343..a66e3c28e 100644
--- a/include/modules/dns.h
+++ b/include/modules/dns.h
@@ -155,7 +155,6 @@ namespace DNS
, id(0)
, creator(mod)
{
- ServerInstance->Timers.AddTimer(this);
}
virtual ~Request()
diff --git a/src/coremods/core_dns.cpp b/src/coremods/core_dns.cpp
index 91bd45b54..5493470ae 100644
--- a/src/coremods/core_dns.cpp
+++ b/src/coremods/core_dns.cpp
@@ -464,6 +464,9 @@ class MyManager : public Manager, public Timer, public EventHandler
if (SocketEngine::SendTo(this, buffer, len, 0, &this->myserver.sa, this->myserver.sa_size()) != len)
throw Exception("DNS: Unable to send query");
+
+ // Add timer for timeout
+ ServerInstance->Timers.AddTimer(req);
}
void RemoveRequest(DNS::Request* req)