diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-09 20:14:26 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-09 20:14:26 +0000 |
commit | 3020afbbedca81d14bc098e45b02c27a14625a1c (patch) | |
tree | db08161b2172ac3f7285da1ce0bdbdd46bcf541f | |
parent | e2b1ad588d34c3d1d0e4e330acef7ca177b13daf (diff) |
Fix passing wrong instance to resolver
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4824 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/dns.cpp | 4 | ||||
-rw-r--r-- | src/inspircd.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 11 |
3 files changed, 13 insertions, 6 deletions
diff --git a/src/dns.cpp b/src/dns.cpp index f7a2d62e2..882aee1a7 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -241,6 +241,8 @@ int DNS::GetMasterSocket() /* Initialise the DNS UDP socket so that we can send requests */ DNS::DNS(InspIRCd* Instance) : ServerInstance(Instance) { + log(DEBUG,"DNS::DNS: Instance = %08x",Instance); + insp_inaddr addr; /* Clear the Resolver class table */ @@ -833,6 +835,8 @@ DNS::~DNS() /* High level abstraction of dns used by application at large */ Resolver::Resolver(InspIRCd* Instance, const std::string &source, QueryType qt) : ServerInstance(Instance), input(source), querytype(qt) { + log(DEBUG,"Instance: %08x %08x %08x",Instance, ServerInstance, ServerInstance->Res); + insp_inaddr binip; switch (querytype) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 3a4952cc4..6b4800887 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -65,7 +65,7 @@ #include "typedefs.h" #include "command_parse.h" -InspIRCd* ServerInstance; +InspIRCd* ServerInstance = NULL; extern ModuleList modules; extern FactoryList factory; @@ -886,6 +886,8 @@ int InspIRCd::Run() { this->Res = new DNS(this); + log(DEBUG,"RES: %08x",this->Res); + LoadAllModules(this); /* Just in case no modules were loaded - fix for bug #101 */ diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 2eb46d420..003a4868d 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -69,6 +69,7 @@ class ModuleSpanningTree; static ModuleSpanningTree* TreeProtocolModule; extern InspIRCd* ServerInstance; + extern std::vector<Module*> modules; extern std::vector<ircd_module*> factory; extern int MODCOUNT; @@ -3081,7 +3082,7 @@ class ServernameResolver : public Resolver */ Link MyLink; public: - ServernameResolver(const std::string &hostname, Link x) : Resolver(ServerInstance, hostname, DNS_QUERY_FORWARD), MyLink(x) + ServernameResolver(InspIRCd* Instance, const std::string &hostname, Link x) : Resolver(Instance, hostname, DNS_QUERY_FORWARD), MyLink(x) { /* Nothing in here, folks */ } @@ -3122,7 +3123,7 @@ class SecurityIPResolver : public Resolver private: Link MyLink; public: - SecurityIPResolver(const std::string &hostname, Link x) : Resolver(ServerInstance, hostname, DNS_QUERY_FORWARD), MyLink(x) + SecurityIPResolver(InspIRCd* Instance, const std::string &hostname, Link x) : Resolver(Instance, hostname, DNS_QUERY_FORWARD), MyLink(x) { } @@ -3371,7 +3372,7 @@ void ReadConfiguration(bool rebind) { try { - SecurityIPResolver* sr = new SecurityIPResolver(L.IPAddr, L); + SecurityIPResolver* sr = new SecurityIPResolver(ServerInstance, L.IPAddr, L); Srv->AddResolver(sr); } catch (ModuleException& e) @@ -3787,7 +3788,7 @@ class ModuleSpanningTree : public Module { try { - ServernameResolver* snr = new ServernameResolver(x->IPAddr, *x); + ServernameResolver* snr = new ServernameResolver(ServerInstance,x->IPAddr, *x); Srv->AddResolver(snr); } catch (ModuleException& e) @@ -3868,7 +3869,7 @@ class ModuleSpanningTree : public Module { try { - ServernameResolver* snr = new ServernameResolver(x->IPAddr, *x); + ServernameResolver* snr = new ServernameResolver(ServerInstance, x->IPAddr, *x); Srv->AddResolver(snr); } catch (ModuleException& e) |