From 0584675861f05321b89fff44fda38ebd49006e54 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Wed, 17 Feb 2010 17:22:23 -0600 Subject: 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: --- src/modules/m_spanningtree/treesocket1.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (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 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(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(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(linkID, 30); -- cgit v1.3.1-10-gc9f91