summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-06 18:49:30 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-06 18:49:30 +0000
commitc328ffca4cdb0300e6eee88f91e718ce9ba850ce (patch)
treefe037d19746f526e86569634a773b28b7a369e0f /src
parent6cba4035015b2f00eff989708131933bd2d51226 (diff)
Stuff to allow resolving of AAAA record, and on failure try A record
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6521 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/resolvers.cpp9
-rw-r--r--src/modules/m_spanningtree/resolvers.h6
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);
};