diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/resolvers.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_spanningtree/resolvers.h | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp index 01e994d57..8165244af 100644 --- a/src/modules/m_spanningtree/resolvers.cpp +++ b/src/modules/m_spanningtree/resolvers.cpp @@ -25,7 +25,7 @@ * callback to OnLookupComplete or OnError when completed. Once it has completed we * will have an IP address which we can then use to continue our connection. */ -ServernameResolver::ServernameResolver(Module* me, SpanningTreeUtilities* Util, InspIRCd* Instance, const std::string &hostname, Link x, bool &cached) : Resolver(Instance, hostname, DNS_QUERY_FORWARD, cached, me), MyLink(x), Utils(Util) +ServernameResolver::ServernameResolver(Module* me, SpanningTreeUtilities* Util, InspIRCd* Instance, const std::string &hostname, Link x, bool &cached, QueryType qt) : Resolver(Instance, hostname, qt, cached, me), MyLink(x), Utils(Util), query(qt), host(hostname), mine(me) { /* Nothing in here, folks */ } @@ -62,6 +62,13 @@ void ServernameResolver::OnLookupComplete(const std::string &result, unsigned in void ServernameResolver::OnError(ResolverError e, const std::string &errormessage) { /* Ooops! */ + if (query == QUERY_TYPE_AAAA) + { + bool cached; + ServernameResolver* snr = new ServernameResolver(mine, Utils, ServerInstance, host, MyLink, cached, DNS_QUERY_A); + ServerInstance->AddResolver(snr, cached); + return; + } ServerInstance->SNO->WriteToSnoMask('l',"CONNECT: Error connecting \002%s\002: Unable to resolve hostname - %s",MyLink.Name.c_str(),errormessage.c_str()); Utils->DoFailOver(&MyLink); } diff --git a/src/modules/m_spanningtree/resolvers.h b/src/modules/m_spanningtree/resolvers.h index 3828985d4..10cc6f3ca 100644 --- a/src/modules/m_spanningtree/resolvers.h +++ b/src/modules/m_spanningtree/resolvers.h @@ -44,6 +44,7 @@ class SecurityIPResolver : public Resolver bool cached; SecurityIPResolver* res = new SecurityIPResolver(mine, Utils, ServerInstance, host, MyLink, cached, DNS_QUERY_A); ServerInstance->AddResolver(res, cached); + return; } ServerInstance->Log(DEFAULT,"Could not resolve IP associated with Link '%s': %s",MyLink.Name.c_str(),errormessage.c_str()); } @@ -64,8 +65,11 @@ class ServernameResolver : public Resolver */ Link MyLink; SpanningTreeUtilities* Utils; + QueryType query; + std::string host; + Module* mine; public: - ServernameResolver(Module* me, SpanningTreeUtilities* Util, InspIRCd* Instance, const std::string &hostname, Link x, bool &cached); + ServernameResolver(Module* me, SpanningTreeUtilities* Util, InspIRCd* Instance, const std::string &hostname, Link x, bool &cached, QueryType qt); void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached); void OnError(ResolverError e, const std::string &errormessage); }; |