]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Fix --with-max-clients not taking a parameter (reported by erich)
[user/henk/code/inspircd.git] / src / inspircd.cpp
index c8be0d019a3c8f8bcf3733d96456611432850f69..d5146e900edd7e1af648820a57dfa4298fa9731b 100644 (file)
@@ -139,6 +139,7 @@ void InspIRCd::Rehash(int status)
        SI->CloseLog();
        SI->OpenLog(NULL,0);
        SI->RehashUsersAndChans();
+       FOREACH_MOD_I(SI, I_OnGarbageCollect, OnGarbageCollect());
        SI->Config->Read(false,NULL);
        FOREACH_MOD_I(SI,I_OnRehash,OnRehash(""));
 }
@@ -814,6 +815,8 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
                if ((TIME % 3600) == 0)
                {
                        irc::whowas::MaintainWhoWas(this, TIME);
+                       this->RehashUsersAndChans();
+                       FOREACH_MOD_I(this, I_OnGarbageCollect, OnGarbageCollect());
                }
                Timers->TickTimers(TIME);
                this->DoBackgroundUserStuff(TIME);
@@ -959,7 +962,8 @@ bool FileLogger::Readable()
 void FileLogger::HandleEvent(EventType et, int errornum)
 {
        this->WriteLogLine("");
-       ServerInstance->SE->DelFd(this);
+       if (log)
+               ServerInstance->SE->DelFd(this);
 }
 
 void FileLogger::WriteLogLine(const std::string &line)
@@ -1000,18 +1004,24 @@ void FileLogger::Close()
                fcntl(fileno(log), F_SETFL, flags ^ O_NONBLOCK);
                if (buffer.size())
                        fprintf(log,"%s",buffer.c_str());
+
+               ServerInstance->SE->DelFd(this);
+
                fflush(log);
                fclose(log);
        }
+
        buffer = "";
-       ServerInstance->SE->DelFd(this);
 }
 
 FileLogger::FileLogger(InspIRCd* Instance, FILE* logfile) : ServerInstance(Instance), log(logfile), writeops(0)
 {
-       irc::sockets::NonBlocking(fileno(log));
-       this->SetFd(fileno(log));
-       buffer = "";
+       if (log)
+       {
+               irc::sockets::NonBlocking(fileno(log));
+               this->SetFd(fileno(log));
+               buffer = "";
+       }
 }
 
 FileLogger::~FileLogger()