]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/server.cpp
Thread safety fixes to avoid crashes on rehash, dont reopen logs within the rehash...
[user/henk/code/inspircd.git] / src / server.cpp
index 8879e1eb8181d5699ddb2c40fe5f2eb2f7cabcfe..44f2ce78f8387f9b0816487978c1990de8675b82 100644 (file)
@@ -48,6 +48,7 @@ void InspIRCd::Exit(int status)
 
 void RehashHandler::Call(const std::string &reason)
 {
+       Server->RehashFinishMutex->Lock();
        Server->SNO->WriteToSnoMask('A', "Rehashing config file %s %s",ServerConfig::CleanFilename(Server->ConfigFileName), reason.c_str());
        Server->RehashUsersAndChans();
        FOREACH_MOD_I(Server, I_OnGarbageCollect, OnGarbageCollect());
@@ -59,6 +60,7 @@ void RehashHandler::Call(const std::string &reason)
                Server->ConfigThread = new ConfigReaderThread(Server, false, "");
                Server->Threads->Create(Server->ConfigThread);
        }
+       Server->RehashFinishMutex->Unlock();
 }
 
 void InspIRCd::RehashServer()
@@ -86,7 +88,7 @@ void InspIRCd::BuildISupport()
        std::stringstream v;
        v << "WALLCHOPS WALLVOICES MODES=" << Config->Limits.MaxModes << " CHANTYPES=# PREFIX=" << this->Modes->BuildPrefixes() << " MAP MAXCHANNELS=" << Config->MaxChans << " MAXBANS=60 VBANLIST NICKLEN=" << Config->Limits.NickMax;
        v << " CASEMAPPING=rfc1459 STATUSMSG=@" << (this->Config->AllowHalfop ? "%" : "") << "+ CHARSET=ascii TOPICLEN=" << Config->Limits.MaxTopic << " KICKLEN=" << Config->Limits.MaxKick << " MAXTARGETS=" << Config->MaxTargets;
-       v << " AWAYLEN=" << Config->Limits.MaxAway << " CHANMODES=" << this->Modes->ChanModes() << " FNC NETWORK=" << Config->Network << " MAXPARA=32 ELIST=MU";
+       v << " AWAYLEN=" << Config->Limits.MaxAway << " CHANMODES=" << this->Modes->GiveModeList(MASK_CHANNEL) << " FNC NETWORK=" << Config->Network << " MAXPARA=32 ELIST=MU";
        Config->data005 = v.str();
        FOREACH_MOD_I(this,I_On005Numeric,On005Numeric(Config->data005));
        Config->Update005();