]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
spanningtree now correctly uses OnReadConfig, so its config is AVAILABLE when it...
[user/henk/code/inspircd.git] / src / inspircd.cpp
index d1af4188caf7163a4d93faac34e88562a7e9e19c..e1c40199a6451e567574277b80d63a96e320f905 100644 (file)
@@ -232,14 +232,14 @@ bool InspIRCd::DaemonSeed()
        rlimit rl;
        if (getrlimit(RLIMIT_CORE, &rl) == -1)
        {
-               this->Log(DEFAULT,"Failed to getrlimit()!");
+               this->Logs->Log("STARTUP",DEFAULT,"Failed to getrlimit()!");
                return false;
        }
        else
        {
                rl.rlim_cur = rl.rlim_max;
                if (setrlimit(RLIMIT_CORE, &rl) == -1)
-                       this->Log(DEFAULT,"setrlimit() failed, cannot increase coredump size.");
+                       this->Logs->Log("STARTUP",DEFAULT,"setrlimit() failed, cannot increase coredump size.");
        }
 
        return true;
@@ -268,7 +268,7 @@ void InspIRCd::WritePID(const std::string &filename)
        else
        {
                printf("Failed to write PID-file '%s', exiting.\n",fname.c_str());
-               this->Log(DEFAULT,"Failed to write PID-file '%s', exiting.",fname.c_str());
+               this->Logs->Log("STARTUP",DEFAULT,"Failed to write PID-file '%s', exiting.",fname.c_str());
                Exit(EXIT_STATUS_PID);
        }
 }
@@ -308,6 +308,11 @@ InspIRCd::InspIRCd(int argc, char** argv)
        SE = SEF->Create(this);
        delete SEF;
 
+
+       ThreadEngineFactory* tef = new ThreadEngineFactory();
+       this->Threads = tef->Create(this);
+       delete tef;
+
        this->s_signal = 0;
        
        // Create base manager classes early, so nothing breaks
@@ -426,7 +431,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
        if (!ServerConfig::FileExists(this->ConfigFileName))
        {
                printf("ERROR: Cannot open config file: %s\nExiting...\n", this->ConfigFileName);
-               this->Log(DEFAULT,"Unable to open config file %s", this->ConfigFileName);
+               this->Logs->Log("STARTUP",DEFAULT,"Unable to open config file %s", this->ConfigFileName);
                Exit(EXIT_STATUS_CONFIG);
        }
 
@@ -477,15 +482,13 @@ InspIRCd::InspIRCd(int argc, char** argv)
 
        SE->RecoverFromFork();
 
-       /* Read config, pass 0. At the end if this pass,
-        * the Config->IncludeFiles is populated, we call
-        * Config->StartDownloads to initialize the downlaods of all
-        * these files.
+       /* During startup we don't actually initialize this
+        * in the thread engine.
         */
-       Config->Read(true, NULL, 0);
-       Config->DoDownloads();
-       /* We have all the files we can get, initiate pass 1 */
-       Config->Read(true, NULL, 1);
+       this->ConfigThread = new ConfigReaderThread(this);
+       ConfigThread->Run();
+       delete ConfigThread;
+       this->ConfigThread = NULL;
 
        this->AddServerName(Config->ServerName);
 
@@ -704,7 +707,7 @@ void InspIRCd::BufferedSocketCull()
 {
        for (std::map<BufferedSocket*,BufferedSocket*>::iterator x = SocketCull.begin(); x != SocketCull.end(); ++x)
        {
-               Log(DEBUG,"Cull socket");
+               this->Logs->Log("MISC",DEBUG,"Cull socket");
                SE->DelFd(x->second);
                x->second->Close();
                delete x->second;