]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Fixed to not allow :Abc NICK Abc, where the case of the old and new nick are *identical*
[user/henk/code/inspircd.git] / src / inspircd.cpp
index e787da5aef70da30d258b7b84a45a0df3d761256..e65816f48bbcf07daad8e3e6bbdef505b467743c 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];
 
@@ -89,7 +86,6 @@ SocketEngine* SE = NULL;
 // by an integer, meaning there is no need for a scan/search operation.
 userrec* fd_ref_table[65536];
 
-serverstats* stats = new serverstats;
 Server* MyServer = new Server;
 ServerConfig *Config = new ServerConfig;
 
@@ -138,7 +134,19 @@ std::string InspIRCd::GetRevision()
        return single;
 }
 
-
+void InspIRCd::MakeLowerMap()
+{
+       // initialize the lowercase mapping table
+       for (unsigned int cn = 0; cn < 256; cn++)
+               lowermap[cn] = cn;
+       // lowercase the uppercase chars
+       for (unsigned int cn = 65; cn < 91; cn++)
+               lowermap[cn] = tolower(cn);
+       // now replace the specific chars for scandanavian comparison
+       lowermap[(unsigned)'['] = '{';
+       lowermap[(unsigned)']'] = '}';
+       lowermap[(unsigned)'\\'] = '|';
+}
 
 InspIRCd::InspIRCd(int argc, char** argv)
 {
@@ -170,18 +178,8 @@ InspIRCd::InspIRCd(int argc, char** argv)
        }
 
        strlcpy(Config->MyExecutable,argv[0],MAXBUF);
-       
-       // initialize the lowercase mapping table
-       for (unsigned int cn = 0; cn < 256; cn++)
-               lowermap[cn] = cn;
-       // lowercase the uppercase chars
-       for (unsigned int cn = 65; cn < 91; cn++)
-               lowermap[cn] = tolower(cn);
-       // now replace the specific chars for scandanavian comparison
-       lowermap[(unsigned)'['] = '{';
-       lowermap[(unsigned)']'] = '}';
-       lowermap[(unsigned)'\\'] = '|';
 
+       this->MakeLowerMap();
 
         OpenLog(argv, argc);
         Config->ClearStack();
@@ -189,6 +187,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
         CheckRoot();
        this->ModeGrok = new ModeParser();
        this->Parser = new CommandParser();
+       this->stats = new serverstats();
         AddServerName(Config->ServerName);
         CheckDie();
         stats->BoundPortCount = BindPorts();
@@ -396,7 +395,7 @@ int InspIRCd::Run()
 
        /* Until THIS point, ServerInstance == NULL */
        
-        LoadAllModules();
+        LoadAllModules(this);
 
         printf("\nInspIRCd is now running!\n");
        
@@ -528,9 +527,10 @@ int InspIRCd::Run()
                                                 */
                                                if (incomingSockfd >= 0)
                                                {
-                                                       if (IOHookModule)
+                                                       NonBlocking(incomingSockfd);
+                                                       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);