summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/resolvers.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-08 23:29:21 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-08 23:29:21 +0000
commit7e843c22e16c81054bad18073d24fe1a07026431 (patch)
tree44ca0213c7d7a80270b993fec1fbed275ec56424 /src/modules/m_spanningtree/resolvers.cpp
parentc440038736f749a56dbac1badee5b2f099286117 (diff)
Update Event and Request APIs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11808 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/resolvers.cpp')
-rw-r--r--src/modules/m_spanningtree/resolvers.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp
index e168b98f5..b95ba79c3 100644
--- a/src/modules/m_spanningtree/resolvers.cpp
+++ b/src/modules/m_spanningtree/resolvers.cpp
@@ -14,7 +14,6 @@
#include "inspircd.h"
#include "socket.h"
#include "xline.h"
-#include "../transport.h"
#include "resolvers.h"
#include "main.h"
@@ -31,10 +30,9 @@
* 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, const std::string &hostname, Link* x, bool &cached, QueryType qt, Autoconnect* myac)
- : Resolver(hostname, qt, cached, me), Utils(Util), query(qt), host(hostname), mine(me), MyLink(x), myautoconnect(myac)
+ServernameResolver::ServernameResolver(SpanningTreeUtilities* Util, const std::string &hostname, Link* x, bool &cached, QueryType qt, Autoconnect* myac)
+ : Resolver(hostname, qt, cached, Util->Creator), Utils(Util), query(qt), host(hostname), MyLink(x), myautoconnect(myac)
{
- /* Nothing in here, folks */
}
void ServernameResolver::OnLookupComplete(const std::string &result, unsigned int ttl, bool cached)
@@ -46,12 +44,8 @@ void ServernameResolver::OnLookupComplete(const std::string &result, unsigned in
TreeServer* CheckDupe = Utils->FindServer(MyLink->Name.c_str());
if (!CheckDupe) /* Check that nobody tried to connect it successfully while we were resolving */
{
-
- if ((!MyLink->Hook.empty()) && (Utils->hooks.find(MyLink->Hook.c_str()) == Utils->hooks.end()))
- return;
-
- TreeSocket* newsocket = new TreeSocket(this->Utils, result,MyLink->Port,MyLink->Timeout ? MyLink->Timeout : 10,MyLink->Name.c_str(),
- MyLink->Bind, myautoconnect, MyLink->Hook.empty() ? NULL : Utils->hooks[MyLink->Hook.c_str()]);
+ TreeSocket* newsocket = new TreeSocket(Utils, result, MyLink->Port, MyLink->Timeout ? MyLink->Timeout : 10,
+ MyLink->Name.c_str(), MyLink->Bind, myautoconnect, MyLink->Hook);
if (newsocket->GetFd() > -1)
{
/* We're all OK */
@@ -72,7 +66,7 @@ void ServernameResolver::OnError(ResolverError e, const std::string &errormessag
if (query == DNS_QUERY_AAAA)
{
bool cached;
- ServernameResolver* snr = new ServernameResolver(mine, Utils, host, MyLink, cached, DNS_QUERY_A, myautoconnect);
+ ServernameResolver* snr = new ServernameResolver(Utils, host, MyLink, cached, DNS_QUERY_A, myautoconnect);
ServerInstance->AddResolver(snr, cached);
return;
}