X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigreader.cpp;h=a922543a38ced7ab71137d8c1ef145e6fabcb35d;hb=d618b3c186e58a55ab5103da2790459daed6c45e;hp=77f61c97866e7c867c05b5c9ae95b981dce75938;hpb=0b3f568a7506fb7ddc9a24d6ab12a969befb923d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configreader.cpp b/src/configreader.cpp index 77f61c978..a922543a3 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -36,7 +36,6 @@ ServerConfig::ServerConfig() dns_timeout = 5; MaxTargets = 20; NetBufferSize = 10240; - SoftLimit = SocketEngine::GetMaxFds(); MaxConn = SOMAXCONN; MaxChans = 20; OperMaxChans = 30; @@ -70,17 +69,16 @@ bool ServerConfig::ApplyDisabledCommands(const std::string& data) std::string thiscmd; /* Enable everything first */ - for (Commandtable::iterator x = ServerInstance->Parser->cmdlist.begin(); x != ServerInstance->Parser->cmdlist.end(); x++) + const CommandParser::CommandMap& commands = ServerInstance->Parser.GetCommands(); + for (CommandParser::CommandMap::const_iterator x = commands.begin(); x != commands.end(); ++x) x->second->Disable(false); /* Now disable all the ones which the user wants disabled */ while (dcmds >> thiscmd) { - Commandtable::iterator cm = ServerInstance->Parser->cmdlist.find(thiscmd); - if (cm != ServerInstance->Parser->cmdlist.end()) - { - cm->second->Disable(true); - } + Command* handler = ServerInstance->Parser.GetHandler(thiscmd); + if (handler) + handler->Disable(true); } return true; } @@ -366,7 +364,7 @@ void ServerConfig::Fill() if (!nsid.empty() && nsid != sid) throw CoreException("You must restart to change the server id"); } - SoftLimit = ConfValue("performance")->getInt("softlimit", SocketEngine::GetMaxFds(), 10, SocketEngine::GetMaxFds()); + SoftLimit = ConfValue("performance")->getInt("softlimit", (SocketEngine::GetMaxFds() > 0 ? SocketEngine::GetMaxFds() : LONG_MAX), 10); CCOnConnect = ConfValue("performance")->getBool("clonesonconnect", true); MaxConn = ConfValue("performance")->getInt("somaxconn", SOMAXCONN); XLineMessage = options->getString("xlinemessage", options->getString("moronbanner", "You're banned!")); @@ -785,6 +783,9 @@ void ConfigReaderThread::Finish() for (ModuleManager::ModuleMap::const_iterator i = mods.begin(); i != mods.end(); ++i) i->second->ReadConfig(status); + // The description of this server may have changed - update it for WHOIS etc. + ServerInstance->FakeClient->server->description = Config->ServerDesc; + ServerInstance->ISupport.Build(); ServerInstance->Logs->CloseLogs();