]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Put log-switching back into configreader
[user/henk/code/inspircd.git] / src / configreader.cpp
index 99261120fc20f0ab474b641be6a2633a73bd5508..ef12dda642b0a077d0b88f4205b8d7b0ea064622 100644 (file)
@@ -799,6 +799,8 @@ void ServerConfig::Read(bool bail, User* user)
        static char announceinvites[MAXBUF];    /* options:announceinvites setting */
        errstr.clear();
 
+       include_stack.clear();
+
        /* These tags MUST occur and must ONLY occur once in the config file */
        static const char* Once[] = { "server", "admin", "files", "power", "options", NULL };
 
@@ -1156,6 +1158,10 @@ void ServerConfig::Read(bool bail, User* user)
 
         ServerInstance->Log(DEFAULT,"Done reading configuration file.");
 
+       /* Switch over logfiles */
+       ServerInstance->Logs->CloseLogs();
+       ServerInstance->Logs->OpenFileLogs();
+
         /* If we're rehashing, let's load any new modules, and unload old ones
          */
         if (!bail)
@@ -2156,6 +2162,7 @@ bool DoneELine(ServerConfig* conf, const char* tag)
 
 void ConfigReaderThread::Run()
 {
-       ServerInstance->Config->Read(true, NULL);
+       /* TODO: TheUser may be invalid by the time we get here! Check its validity, or pass a UID would be better */
+       ServerInstance->Config->Read(do_bail, TheUser);
 }