diff options
author | Adam <Adam@anope.org> | 2010-09-14 18:24:14 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-09-14 18:24:14 -0400 |
commit | e7ac33fd622ae6e21bc9af684832b7de5cfa0c0c (patch) | |
tree | 1a9f5208bf3109db46b3b73c0030bcaba4039523 /include | |
parent | 630f3815ce5e1eac9dd8f82601c955131c3dce68 (diff) |
Cleanup DNS requests when modules are unloaded, fixes unloading m_dnsbl during the middle of queries
Diffstat (limited to 'include')
-rw-r--r-- | include/dns.h | 7 | ||||
-rw-r--r-- | include/modules.h | 11 |
2 files changed, 6 insertions, 12 deletions
diff --git a/include/dns.h b/include/dns.h index a8ef82d44..97cb0a677 100644 --- a/include/dns.h +++ b/include/dns.h @@ -48,6 +48,7 @@ enum DNSError class DNSRequestTimeout; // Forward declarations struct DNSRecord; +class Module; /** The request */ @@ -57,12 +58,14 @@ class DNSRequest DNSRequestTimeout *timeout; public: + Module *creator; + /* Address we're looking up */ Anope::string address; /* QueryType, A, AAAA, PTR etc */ QueryType QT; - DNSRequest(const Anope::string &addr, QueryType qt, bool cache = false); + DNSRequest(const Anope::string &addr, QueryType qt, bool cache = false, Module *c = NULL); virtual ~DNSRequest(); @@ -158,6 +161,8 @@ class DNSManager : public Timer void AddCache(DNSRecord *rr); bool CheckCache(DNSRequest *request); void Tick(time_t now); + + void Cleanup(Module *mod); }; /** A DNS timeout, one is made for every DNS request to detect timeouts diff --git a/include/modules.h b/include/modules.h index 60a16a978..ac76a4534 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1294,17 +1294,6 @@ class service_reference : public dynamic_reference<T> inline T *operator->() { - if (this->invalid) - { - this->invalid = false; - this->ref = NULL; - } - if (!this->ref) - { - this->ref = static_cast<T *>(ModuleManager::GetService(this->name)); - if (this->ref) - this->ref->AddReference(this); - } return this->ref; } }; |