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_httpd.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/modules/m_httpd.cpp') diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 8aab3a6a4..a23072500 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -52,10 +52,6 @@ class HttpServerSocket : public BufferedSocket : BufferedSocket(newfd), ip(IP), postsize(0) { InternalState = HTTP_SERVE_WAIT_REQUEST; - - FOREACH_MOD(I_OnHookIO, OnHookIO(this, via)); - if (GetIOHook()) - GetIOHook()->OnStreamSocketAccept(this, client, server); } virtual void OnError(BufferedSocketError) @@ -339,15 +335,14 @@ class ModuleHttpServer : public Module resp.src.sock->Page(resp.document, resp.responsecode, &resp.headers); } - ModResult OnAcceptConnection(int nfd, ListenSocket* from, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server) + StreamSocket* OnAcceptConnection(int nfd, ListenSocket* from, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server) { if (from->bind_tag->getString("type") != "httpd") - return MOD_RES_PASSTHRU; + return NULL; int port; std::string incomingip; irc::sockets::satoap(*client, incomingip, port); - new HttpServerSocket(nfd, incomingip, from, client, server); - return MOD_RES_ALLOW; + return new HttpServerSocket(nfd, incomingip, from, client, server); } -- cgit v1.3.1-10-gc9f91