]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Move whowas containers into whowas class to avoid all cpp files including cmd_whowas...
[user/henk/code/inspircd.git] / src / inspircd.cpp
index 198d4a1dbff04a12b2c9f1965a42c8295de51316..efb842f60ac1e473241df1022bd8bd9c04e003ec 100644 (file)
@@ -28,9 +28,9 @@
 #include "command_parse.h"
 #include "exitcodes.h"
 #include <dlfcn.h>
-/* GNUs smell. */
 #include <getopt.h>
 
+
 using irc::sockets::NonBlocking;
 using irc::sockets::Blocking;
 using irc::sockets::insp_ntoa;
@@ -81,8 +81,12 @@ void InspIRCd::Cleanup()
        int MyModCount = this->GetModuleCount();
 
        for (unsigned int i = 0; i < stats->BoundPortCount; i++)
+       {
                /* This calls the constructor and closes the listening socket */
                delete Config->openSockfd[i];
+               Config->openSockfd[i] = NULL;
+       }
+       stats->BoundPortCount = 0;
 
        /* We do this more than once, so that any service providers get a
         * chance to be unhooked by the modules using them, but then get
@@ -140,11 +144,12 @@ void InspIRCd::Rehash(int status)
 {
        SI->WriteOpers("Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(CONFIG_FILE));
        SI->CloseLog();
-       SI->OpenLog(NULL,0);
+       SI->OpenLog(SI->Config->argv, SI->Config->argc);
        SI->RehashUsersAndChans();
        FOREACH_MOD_I(SI, I_OnGarbageCollect, OnGarbageCollect());
        SI->Config->Read(false,NULL);
-       FOREACH_MOD_I(SI,I_OnRehash,OnRehash(""));
+       SI->Res->Rehash();
+       FOREACH_MOD_I(SI,I_OnRehash,OnRehash(NULL,""));
 }
 
 /** Because hash_map doesnt free its buckets when we delete items (this is a 'feature')
@@ -268,6 +273,8 @@ InspIRCd::InspIRCd(int argc, char** argv)
        modules.resize(255);
        factory.resize(255);
 
+       this->unregistered_count = 0;
+
        this->clientlist = new user_hash();
        this->chanlist = new chan_hash();
 
@@ -284,7 +291,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
        this->time_delta = 0;
        this->next_call = this->TIME + 3;
        srand(this->TIME);
-       this->Log(DEBUG,"*** InspIRCd starting up!");
+
        if (!ServerConfig::FileExists(CONFIG_FILE))
        {
                printf("ERROR: Cannot open config file: %s\nExiting...\n",CONFIG_FILE);
@@ -333,8 +340,8 @@ InspIRCd::InspIRCd(int argc, char** argv)
 
        this->OpenLog(argv, argc);
        this->stats = new serverstats();
-       this->Parser = new CommandParser(this);
        this->Timers = new TimerManager();
+       this->Parser = new CommandParser(this);
        this->XLines = new XLineManager(this);
        Config->ClearStack();
        Config->Read(true, NULL);
@@ -814,7 +821,6 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
                        WriteOpers("*** \002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",abs(OLDTIME-TIME));
                if ((TIME % 3600) == 0)
                {
-                       irc::whowas::MaintainWhoWas(this, TIME);
                        this->RehashUsersAndChans();
                        FOREACH_MOD_I(this, I_OnGarbageCollect, OnGarbageCollect());
                }