From b6a5e2bd143cdd2fc610f79c87729d2e211da7ff Mon Sep 17 00:00:00 2001 From: danieldg Date: Fri, 9 Oct 2009 19:00:09 +0000 Subject: Add server ports to ServerInstance->ports, enable SSL on them using OnHookIO git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11810 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/treesocket1.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/modules/m_spanningtree/treesocket1.cpp') diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 2c845bbd4..432ee2a09 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -38,9 +38,30 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, const std::string& shost, in capab_phase = 0; proto_version = 0; LinkState = CONNECTING; + if (!hook.empty()) + { + modulelist* ml = ServerInstance->Modules->FindInterface("BufferedSocketHook"); + if (ml) + { + for(modulelist::iterator i = ml->begin(); i != ml->end(); ++i) + { + std::string name = (**i).ModuleSourceFile; + int a = name.rfind('_'); + int b = name.rfind('.'); + name = name.substr(a, b-a-1); + if (name == hook) + { + AddIOHook(*i); + goto found; + } + } + } + SetError("Could not find hook '" + hook + "' for connection to " + ServerName); + return; + } +found: DoConnect(shost, iport, maxtime, bindto); Utils->timeoutlist[this] = std::pair(ServerName, maxtime); - // TODO AddIOHook using the given hook SendCapabilities(1); } -- cgit v1.2.3