]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Added IOHookModule stuff to allow for different modules to hook different ports
[user/henk/code/inspircd.git] / src / inspircd.cpp
index 0b9c5f9756bee5cd8f8226bfaa650e5a369fbc7b..c370c7f842d462f0fa6610dcbfc35f4f3e33c3a6 100644 (file)
@@ -37,7 +37,6 @@ using namespace std;
 #include <sstream>
 #include <vector>
 #include <deque>
-#include <sched.h>
 #ifdef THREADED_DNS
 #include <pthread.h>
 #endif
@@ -58,7 +57,6 @@ using namespace std;
 #include "socketengine.h"
 #include "userprocess.h"
 #include "socket.h"
-#include "dns.h"
 #include "typedefs.h"
 #include "command_parse.h"
 
@@ -76,7 +74,6 @@ extern int MODCOUNT;
 int openSockfd[MAXSOCKS];
 sockaddr_in client,server;
 socklen_t length;
-extern Module* IOHookModule;
 
 extern InspSocket* socket_ref[65535];
 
@@ -398,7 +395,7 @@ int InspIRCd::Run()
 
        /* Until THIS point, ServerInstance == NULL */
        
-        LoadAllModules();
+        LoadAllModules(this);
 
         printf("\nInspIRCd is now running!\n");
        
@@ -530,9 +527,9 @@ int InspIRCd::Run()
                                                 */
                                                if (incomingSockfd >= 0)
                                                {
-                                                       if (IOHookModule)
+                                                       if (Config->GetIOHook(in_port))
                                                        {
-                                                               IOHookModule->OnRawSocketAccept(incomingSockfd, target, in_port);
+                                                               Config->GetIOHook(in_port)->OnRawSocketAccept(incomingSockfd, target, in_port);
                                                        }
                                                        stats->statsAccept++;
                                                        AddClient(incomingSockfd, target, in_port, false, target);