diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-08 23:29:21 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-08 23:29:21 +0000 |
commit | 7e843c22e16c81054bad18073d24fe1a07026431 (patch) | |
tree | 44ca0213c7d7a80270b993fec1fbed275ec56424 /src/modules/extra/m_ziplink.cpp | |
parent | c440038736f749a56dbac1badee5b2f099286117 (diff) |
Update Event and Request APIs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11808 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_ziplink.cpp')
-rw-r--r-- | src/modules/extra/m_ziplink.cpp | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/src/modules/extra/m_ziplink.cpp b/src/modules/extra/m_ziplink.cpp index 976a27b5c..4b53cf389 100644 --- a/src/modules/extra/m_ziplink.cpp +++ b/src/modules/extra/m_ziplink.cpp @@ -13,12 +13,10 @@ #include "inspircd.h" #include <zlib.h> -#include "transport.h" #include <iostream> /* $ModDesc: Provides zlib link support for servers */ /* $LinkerFlags: -lz */ -/* $ModDep: transport.h */ /* * ZLIB_BEST_COMPRESSION (9) is used for all sending of data with @@ -57,7 +55,7 @@ class ModuleZLib : public Module public: ModuleZLib() - { + { ServerInstance->Modules->PublishInterface("BufferedSocketHook", this); sessions = new izip_session[ServerInstance->SE->GetMaxFds()]; @@ -66,8 +64,8 @@ class ModuleZLib : public Module total_out_compressed = total_in_compressed = 0; total_out_uncompressed = total_in_uncompressed = 0; - Implementation eventlist[] = { I_OnStats, I_OnRequest }; - ServerInstance->Modules->Attach(eventlist, this, 2); + Implementation eventlist[] = { I_OnStats }; + ServerInstance->Modules->Attach(eventlist, this, 1); // Allocate a buffer which is used for reading and writing data net_buffer_size = ServerInstance->Config->NetBufferSize; @@ -83,44 +81,7 @@ class ModuleZLib : public Module Version GetVersion() { - return Version("Provides zlib link support for servers", VF_VENDOR, API_VERSION); - } - - - /* Handle BufferedSocketHook API requests */ - const char* OnRequest(Request* request) - { - ISHRequest* ISR = (ISHRequest*)request; - if (strcmp("IS_NAME", request->GetId()) == 0) - { - /* Return name */ - return "zip"; - } - else if (strcmp("IS_HOOK", request->GetId()) == 0) - { - ISR->Sock->AddIOHook(this); - return "OK"; - } - else if (strcmp("IS_UNHOOK", request->GetId()) == 0) - { - ISR->Sock->DelIOHook(); - return "OK"; - } - else if (strcmp("IS_HSDONE", request->GetId()) == 0) - { - /* Check for completion of handshake - * (actually, this module doesnt handshake) - */ - return "OK"; - } - else if (strcmp("IS_ATTACH", request->GetId()) == 0) - { - /* Attach certificate data to the inspsocket - * (this module doesnt do that, either) - */ - return NULL; - } - return NULL; + return Version("Provides zlib link support for servers", VF_VENDOR); } /* Handle stats z (misc stats) */ |