]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ziplink.cpp
Add initial query support to m_mysql [patch by Athenon]
[user/henk/code/inspircd.git] / src / modules / extra / m_ziplink.cpp
index 3fb768757cd4c3f8d35b6d668c7192725abd3742..c220460bd858078444f945b269854ccef91b005e 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
 
 #include "inspircd.h"
 #include <zlib.h>
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "socket.h"
-#include "hashcomp.h"
 #include "transport.h"
-
 #include <iostream>
 
 /* $ModDesc: Provides zlib link support for servers */
@@ -63,7 +57,7 @@ class ModuleZLib : public Module
  public:
 
        ModuleZLib(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                ServerInstance->Modules->PublishInterface("BufferedSocketHook", this);
 
@@ -109,7 +103,7 @@ class ModuleZLib : public Module
                        const char* ret = "OK";
                        try
                        {
-                               ret = ServerInstance->Config->AddIOHook((Module*)this, (BufferedSocket*)ISR->Sock) ? "OK" : NULL;
+                               ret = ISR->Sock->AddIOHook((Module*)this) ? "OK" : NULL;
                        }
                        catch (ModuleException& e)
                        {
@@ -120,7 +114,7 @@ class ModuleZLib : public Module
                else if (strcmp("IS_UNHOOK", request->GetId()) == 0)
                {
                        /* Detach from an inspsocket */
-                       return ServerInstance->Config->DelIOHook((BufferedSocket*)ISR->Sock) ? "OK" : NULL;
+                       return ISR->Sock->DelIOHook() ? "OK" : NULL;
                }
                else if (strcmp("IS_HSDONE", request->GetId()) == 0)
                {
@@ -140,7 +134,7 @@ class ModuleZLib : public Module
        }
 
        /* Handle stats z (misc stats) */
-       virtual int OnStats(char symbol, User* user, string_list &results)
+       virtual ModResult OnStats(char symbol, User* user, string_list &results)
        {
                if (symbol == 'z')
                {
@@ -174,10 +168,10 @@ class ModuleZLib : public Module
                        results.push_back(sn+" 304 "+user->nick+" :ZIPSTATS percentage_of_original_outbound_traffic        = "+outbound_ratio);
                        results.push_back(sn+" 304 "+user->nick+" :ZIPSTATS percentage_of_orignal_inbound_traffic         = "+inbound_ratio);
                        results.push_back(sn+" 304 "+user->nick+" :ZIPSTATS total_size_of_original_traffic        = "+combined_ratio);
-                       return 0;
+                       return MOD_RES_PASSTHRU;
                }
 
-               return 0;
+               return MOD_RES_PASSTHRU;
        }
 
        virtual void OnRawSocketConnect(int fd)
@@ -217,7 +211,7 @@ class ModuleZLib : public Module
                session->status = IZIP_OPEN;
        }
 
-       virtual void OnRawSocketAccept(int fd, const std::string &ip, int localport)
+       virtual void OnRawSocketAccept(int fd, irc::sockets::sockaddrs*, irc::sockets::sockaddrs*)
        {
                /* Nothing special needs doing here compared to connect() */
                OnRawSocketConnect(fd);