]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ziplink.cpp
Fix STARTTLS sending the 670 numeric within the SSL session, not prior to it
[user/henk/code/inspircd.git] / src / modules / extra / m_ziplink.cpp
index 7d090d80a5f9bd81cf1563df58567a4d37171679..391ba75839a3bd6a7938d7b49c88567e6ff72789 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
 
 #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
@@ -31,7 +29,7 @@ enum izip_status { IZIP_CLOSED = 0, IZIP_OPEN };
 
 /** Represents an zipped connections extra data
  */
-class izip_session : public classbase
+class izip_session
 {
  public:
        z_stream c_stream;      /* compression stream */
@@ -56,19 +54,16 @@ class ModuleZLib : public Module
        unsigned int net_buffer_size;
  public:
 
-       ModuleZLib(InspIRCd* Me)
-               : Module(Me)
+       ModuleZLib()
        {
-               ServerInstance->Modules->PublishInterface("BufferedSocketHook", this);
-
                sessions = new izip_session[ServerInstance->SE->GetMaxFds()];
                for (int i = 0; i < ServerInstance->SE->GetMaxFds(); i++)
                        sessions[i].status = IZIP_CLOSED;
 
                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;
@@ -77,51 +72,13 @@ class ModuleZLib : public Module
 
        ~ModuleZLib()
        {
-               ServerInstance->Modules->UnpublishInterface("BufferedSocketHook", this);
                delete[] sessions;
                delete[] net_buffer;
        }
 
        Version GetVersion()
        {
-               return Version("$Id$", 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) */