summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/treesocket1.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-09 19:00:09 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-09 19:00:09 +0000
commitb6a5e2bd143cdd2fc610f79c87729d2e211da7ff (patch)
treeba36be3c5ccbea6153c2f4785fdbb9b0736db1ad /src/modules/m_spanningtree/treesocket1.cpp
parentc4d6ce8c5e1802e5b834d5845e31c3adf7700585 (diff)
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
Diffstat (limited to 'src/modules/m_spanningtree/treesocket1.cpp')
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp23
1 files changed, 22 insertions, 1 deletions
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<std::string, int>(ServerName, maxtime);
- // TODO AddIOHook using the given hook
SendCapabilities(1);
}