summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/dns.h1
-rw-r--r--src/dns.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/include/dns.h b/include/dns.h
index 97cb0a677..51960b0f4 100644
--- a/include/dns.h
+++ b/include/dns.h
@@ -34,6 +34,7 @@ enum QueryFlags
enum DNSError
{
DNS_ERROR_UNKNOWN,
+ DNS_ERROR_UNLOADED,
DNS_ERROR_TIMEOUT,
DNS_ERROR_NOT_AN_ANSWER,
DNS_ERROR_NONSTANDARD_QUERY,
diff --git a/src/dns.cpp b/src/dns.cpp
index 7b96cf660..ebed29b5e 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -7,7 +7,7 @@ static inline unsigned short GetRandomID()
return random();
}
-DNSRequest::DNSRequest(const Anope::string &addr, QueryType qt, bool cache, Module *c) : address(addr), QT(qt), creator(c)
+DNSRequest::DNSRequest(const Anope::string &addr, QueryType qt, bool cache, Module *c) : creator(c), address(addr), QT(qt)
{
if (!DNSEngine)
DNSEngine = new DNSManager();
@@ -541,6 +541,7 @@ void DNSManager::Cleanup(Module *mod)
if (req->creator && req->creator == mod)
{
+ req->OnError(DNS_ERROR_UNLOADED, "Module is being unloaded");
delete req;
this->requests.erase(id);
}