aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_spanningtree/treesocket1.cpp
diff options
context:
space:
mode:
authorGravatar Daniel De Graaf2010-02-17 17:22:23 -0600
committerGravatar Daniel De Graaf2010-08-03 17:32:36 -0400
commit0584675861f05321b89fff44fda38ebd49006e54 (patch)
treea8cd3ac16fc68d78aeacfb9d1c745cf8311f0bdb /src/modules/m_spanningtree/treesocket1.cpp
parentRemove useless return value from OnUserRegister (diff)
New I/O hook API
This removes some pointless Module:: entries, uses the ServiceProvider lookup API for bind tags, and allows GnuTLS to use custom certificates per bind or link block using: <bind ssl="gnutls" ssl_cert="signed" ...> <ssl_cert name="signed" certfile="my.cert.pem" keyfile="my.key.pem">
Diffstat (limited to 'src/modules/m_spanningtree/treesocket1.cpp')
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 596f31041..2477f7723 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -42,17 +42,18 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, Link* link, Autoconnect* mya
MyRoot = NULL;
proto_version = 0;
LinkState = CONNECTING;
+ DoConnect(ipaddr, link->Port, link->Timeout, link->Bind);
if (!link->Hook.empty())
{
- ServiceProvider* prov = ServerInstance->Modules->FindService(SERVICE_IOHOOK, link->Hook);
+ IOHookProvider* prov =
+ static_cast<IOHookProvider*>(ServerInstance->Modules->FindService(SERVICE_IOHOOK, link->Hook));
if (!prov)
{
SetError("Could not find hook '" + link->Hook + "' for connection to " + linkID);
return;
}
- AddIOHook(prov->creator);
+ prov->OnClientConnection(this, link->tag);
}
- DoConnect(ipaddr, link->Port, link->Timeout, link->Bind);
Utils->timeoutlist[this] = std::pair<std::string, int>(linkID, link->Timeout);
SendCapabilities(1);
}
@@ -72,9 +73,6 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, int newfd, ListenSocket* via
proto_version = 0;
linkID = "inbound from " + client->addr();
- FOREACH_MOD(I_OnHookIO, OnHookIO(this, via));
- if (GetIOHook())
- GetIOHook()->OnStreamSocketAccept(this, client, server);
SendCapabilities(1);
Utils->timeoutlist[this] = std::pair<std::string, int>(linkID, 30);