From deb18ee9cfa531a87141aea61171c6899ef7d687 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sun, 8 Sep 2013 17:21:01 +0200 Subject: Remove InspIRCd::HandleRehash functor Call InspIRCd::Rehash() from cmd_rehash and from the SIGHUP handler --- src/commands/cmd_rehash.cpp | 6 +----- src/inspircd.cpp | 1 - src/server.cpp | 9 ++++----- 3 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/commands/cmd_rehash.cpp b/src/commands/cmd_rehash.cpp index 3dc454036..441ddbd2a 100644 --- a/src/commands/cmd_rehash.cpp +++ b/src/commands/cmd_rehash.cpp @@ -88,11 +88,7 @@ CmdResult CommandRehash::Handle (const std::vector& parameters, Use /* Don't do anything with the logs here -- logs are restarted * after the config thread has completed. */ - FOREACH_MOD(OnGarbageCollect, ()); - - - ServerInstance->ConfigThread = new ConfigReaderThread(user->uuid); - ServerInstance->Threads->Start(ServerInstance->ConfigThread); + ServerInstance->Rehash(); } else { diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 2171e2a9f..8336a4847 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -234,7 +234,6 @@ InspIRCd::InspIRCd(int argc, char** argv) : OperQuit("operquit", NULL), GenRandom(&HandleGenRandom), IsChannel(&HandleIsChannel), - Rehash(&HandleRehash), IsNick(&HandleIsNick), IsIdent(&HandleIsIdent), OnCheckExemption(&HandleOnCheckExemption) diff --git a/src/server.cpp b/src/server.cpp index 97b4058c0..4f58c881d 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -31,7 +31,8 @@ void InspIRCd::SignalHandler(int signal) #else if (signal == SIGHUP) { - Rehash("Caught SIGHUP"); + ServerInstance->SNO->WriteGlobalSno('a', "Rehashing due to SIGHUP"); + Rehash(); } else if (signal == SIGTERM) #endif @@ -55,13 +56,11 @@ void InspIRCd::Exit(int status) exit (status); } -void RehashHandler::Call(const std::string &reason) +void InspIRCd::Rehash(const std::string& uuid) { - ServerInstance->SNO->WriteToSnoMask('a', "Rehashing config file %s %s",ServerConfig::CleanFilename(ServerInstance->ConfigFileName.c_str()), reason.c_str()); - FOREACH_MOD(OnGarbageCollect, ()); if (!ServerInstance->ConfigThread) { - ServerInstance->ConfigThread = new ConfigReaderThread(""); + ServerInstance->ConfigThread = new ConfigReaderThread(uuid); ServerInstance->Threads->Start(ServerInstance->ConfigThread); } } -- cgit v1.2.3