]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_rehash.cpp
Add IP address conversion utility functions, irc::sockets::aptosa and irc::sockets...
[user/henk/code/inspircd.git] / src / commands / cmd_rehash.cpp
index 9a9384af522fb2f3c12aac164c098f2017a2c9bf..e3405161129be0d15349d679078ccf7486693923 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -50,25 +50,22 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use
 
 
        std::string m = user->nick + " is rehashing config file " + ServerConfig::CleanFilename(ServerInstance->ConfigFileName) + " on " + ServerInstance->Config->ServerName;
-       ServerInstance->SNO->WriteToSnoMask('A', m);
-       ServerInstance->Logs->CloseLogs();
+       ServerInstance->SNO->WriteToSnoMask('a', m);
 
-       if (!ServerInstance->OpenLog(ServerInstance->Config->argv, ServerInstance->Config->argc))
-       {
-               m = std::string("ERROR: Could not open logfile ") + ServerInstance->Config->logpath + ":" + strerror(errno);
-               ServerInstance->SNO->WriteToSnoMask('A', m);
-       }
+       /* Don't do anything with the logs here -- logs are restarted
+        * after the config thread has completed.
+        */
 
        ServerInstance->RehashUsersAndChans();
        FOREACH_MOD(I_OnGarbageCollect, OnGarbageCollect());
 
        if (!ServerInstance->ConfigThread)
        {
-               ServerInstance->Config->RehashUser = user;
+               ServerInstance->Config->RehashUserUID = user->uuid;
                ServerInstance->Config->RehashParameter = parameters.size() ? parameters[0] : "";
 
-               ServerInstance->ConfigThread = new ConfigReaderThread(ServerInstance, false, user);
-               ServerInstance->Threads->Create(ServerInstance->ConfigThread);
+               ServerInstance->ConfigThread = new ConfigReaderThread(ServerInstance, false, ServerInstance->Config->RehashUserUID);
+               ServerInstance->Threads->Start(ServerInstance->ConfigThread);
        }
        else
        {