diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-09 21:15:56 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-09 21:15:56 +0000 |
commit | 6d2bf07374515c88734a19ffaac179b7357059ea (patch) | |
tree | b82977fceb97d5ff929c68375a7d4fcd3076fb12 /src/modules/m_spanningtree.cpp | |
parent | 42747aef3eacfeb418cd1ac1d7854e3cc4e66469 (diff) |
It works! WOO AND YAY! (this isnt finished yet, only an idiot would use this on a production net atm)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5897 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r-- | src/modules/m_spanningtree.cpp | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index a0563c255..e96656910 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -680,8 +680,10 @@ class TreeSocket : public InspSocket this->ctx_in = NULL; this->ctx_out = NULL; - if (Hook) - InspSocketHookRequest(this, Hook, (Module*)Utils->Creator).Send(); + Instance->Log(DEBUG, "HOOK = %08x", Hook); + + if (listening && Hook) + InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); } TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string host, int port, bool listening, unsigned long maxtime, std::string ServerName, Module* HookMod = NULL) @@ -691,9 +693,6 @@ class TreeSocket : public InspSocket this->LinkState = CONNECTING; this->ctx_in = NULL; this->ctx_out = NULL; - - if (Hook) - InspSocketHookRequest(this, Hook, (Module*)Utils->Creator).Send(); } /** When a listening socket gives us a new file descriptor, @@ -701,16 +700,18 @@ class TreeSocket : public InspSocket * connection. This constructor is used for this purpose. */ TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, char* ip, Module* HookMod = NULL) - : InspSocket(SI, newfd, ip), Utils(Util) + : InspSocket(SI, newfd, ip), Utils(Util), Hook(HookMod) { this->LinkState = WAIT_AUTH_1; this->ctx_in = NULL; this->ctx_out = NULL; + Instance->Log(DEBUG, "HOOK = %08x", Hook); + if (Hook) - InspSocketHookRequest(this, Hook, (Module*)Utils->Creator).Send(); + InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); - this->SendCapabilities(); + //this->SendCapabilities(); } ~TreeSocket() @@ -721,7 +722,7 @@ class TreeSocket : public InspSocket DELETE(ctx_out); if (Hook) - InspSocketUnhookRequest(this, Hook, (Module*)Utils->Creator).Send(); + InspSocketUnhookRequest(this, (Module*)Utils->Creator, Hook).Send(); } void InitAES(std::string key,std::string SName) @@ -768,7 +769,11 @@ class TreeSocket : public InspSocket if (x->Name == this->myhost) { this->Instance->SNO->WriteToSnoMask('l',"Connection to \2"+myhost+"\2["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] started."); - this->SendCapabilities(); + + if (Hook) + InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); + + //this->SendCapabilities(); if (x->EncryptionKey != "") { if (!(x->EncryptionKey.length() == 16 || x->EncryptionKey.length() == 24 || x->EncryptionKey.length() == 32)) @@ -4100,8 +4105,12 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind) if (IP == "*") IP = ""; - if ((!transport.empty()) && (hooks.find(transport.c_str()) == hooks.end())) - return; + if ((!transport.empty()) && (hooks.find(transport.c_str()) == hooks.end())) + { + ServerInstance->Log(DEFAULT,"m_spanningtree: WARNING: Can't find transport type '%s' - maybe you forgot to load it BEFORE m_spanningtree in your config file?", + transport.c_str()); + continue; + } TreeSocket* listener = new TreeSocket(this, ServerInstance, IP.c_str(), portno, true, 10, transport.empty() ? NULL : hooks[transport.c_str()]); if (listener->GetState() == I_LISTENING) |