X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fresolvers.h;h=5d4386c4b2c276f5931fb34d244e292da27aafc8;hb=dbf4d595433ecefeb61f1267ffa515a91c3ab548;hp=60133346347489f06c74be98a22d428c37026827;hpb=43847ec9c7e1a195163eb4c529f1c92fd1ace0a4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/resolvers.h b/src/modules/m_spanningtree/resolvers.h index 601333463..5d4386c4b 100644 --- a/src/modules/m_spanningtree/resolvers.h +++ b/src/modules/m_spanningtree/resolvers.h @@ -3,7 +3,7 @@ * +------------------------------------+ * * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -14,33 +14,30 @@ #ifndef __RESOLVERS__H__ #define __RESOLVERS__H__ -#include "commands/cmd_whois.h" -#include "commands/cmd_stats.h" #include "socket.h" #include "inspircd.h" #include "xline.h" -#include "transport.h" -#include "m_spanningtree/utils.h" -#include "m_spanningtree/link.h" +#include "utils.h" +#include "link.h" /** Handle resolving of server IPs for the cache */ class SecurityIPResolver : public Resolver { private: - Link MyLink; + reference MyLink; SpanningTreeUtilities* Utils; Module* mine; std::string host; QueryType query; public: - SecurityIPResolver(Module* me, SpanningTreeUtilities* U, InspIRCd* Instance, const std::string &hostname, Link x, bool &cached, QueryType qt) - : Resolver(Instance, hostname, qt, cached, me), MyLink(x), Utils(U), mine(me), host(hostname), query(qt) + SecurityIPResolver(Module* me, SpanningTreeUtilities* U, const std::string &hostname, Link* x, bool &cached, QueryType qt) + : Resolver(hostname, qt, cached, me), MyLink(x), Utils(U), mine(me), host(hostname), query(qt) { } - void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum = 0) + void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached) { Utils->ValidIPs.push_back(result); } @@ -50,11 +47,12 @@ class SecurityIPResolver : public Resolver if (query == DNS_QUERY_AAAA) { bool cached; - SecurityIPResolver* res = new SecurityIPResolver(mine, Utils, ServerInstance, host, MyLink, cached, DNS_QUERY_A); + SecurityIPResolver* res = new SecurityIPResolver(mine, Utils, host, MyLink, cached, DNS_QUERY_A); ServerInstance->AddResolver(res, cached); return; } - ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Could not resolve IP associated with Link '%s': %s",MyLink.Name.c_str(),errormessage.c_str()); + ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Could not resolve IP associated with Link '%s': %s", + MyLink->Name.c_str(),errormessage.c_str()); } }; @@ -67,19 +65,15 @@ class SecurityIPResolver : public Resolver class ServernameResolver : public Resolver { private: - /** A copy of the Link tag info for what we're connecting to. - * We take a copy, rather than using a pointer, just in case the - * admin takes the tag away and rehashes while the domain is resolving. - */ - Link MyLink; - SpanningTreeUtilities* Utils; + SpanningTreeUtilities* Utils; QueryType query; std::string host; - Module* mine; + reference MyLink; + reference myautoconnect; public: - 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, int resultnum = 0); - void OnError(ResolverError e, const std::string &errormessage); + ServernameResolver(SpanningTreeUtilities* Util, const std::string &hostname, Link* x, bool &cached, QueryType qt, Autoconnect* myac); + void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached); + void OnError(ResolverError e, const std::string &errormessage); }; #endif