X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigreader.cpp;h=bcee938d55208e1aefc3dcc5d0db93cf81820175;hb=b972020b391485d92bd46ce662421fa036ca4ca6;hp=7d204bfb7bda0c9839ae26c4f1ab32b62a029ce8;hpb=8eb4534fa98bd8fb0f02f2b1b7c54ec70ab077cc;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configreader.cpp b/src/configreader.cpp index 7d204bfb7..bcee938d5 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -35,6 +35,7 @@ #endif ServerConfig::ServerConfig() + : NoSnoticeStack(false) { WhoWasGroupSize = WhoWasMaxGroups = WhoWasMaxKeep = 0; RawLog = NoUserDns = HideBans = HideSplits = UndernetMsgPrefix = false; @@ -48,6 +49,14 @@ ServerConfig::ServerConfig() OperMaxChans = 30; c_ipv4_range = 32; c_ipv6_range = 128; + + std::vector* items; + EmptyTag = ConfigTag::create("empty", "", 0, items); +} + +ServerConfig::~ServerConfig() +{ + delete EmptyTag; } void ServerConfig::Update005() @@ -554,7 +563,8 @@ void ServerConfig::Fill() WelcomeNotice = options->getBool("welcomenotice", true); range(SoftLimit, 10, ServerInstance->SE->GetMaxFds(), ServerInstance->SE->GetMaxFds(), ""); - range(MaxConn, 0, SOMAXCONN, SOMAXCONN, ""); + if (ConfValue("performance")->getBool("limitsomaxconn", true)) + range(MaxConn, 0, SOMAXCONN, SOMAXCONN, ""); range(MaxTargets, 1, 31, 20, ""); range(NetBufferSize, 1024, 65534, 10240, ""); range(WhoWasGroupSize, 0, 10000, 10, ""); @@ -648,8 +658,6 @@ void ServerConfig::Fill() OperSpyWhois = SPYWHOIS_SINGLEMSG; else OperSpyWhois = SPYWHOIS_NONE; - - Limits.Finalise(); } // WARNING: it is not safe to use most of the codebase in this function, as it @@ -722,7 +730,7 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) if (valid) ServerInstance->WritePID(this->PID); - if (old) + if (old && valid) { // On first run, ports are bound later on FailedPortList pl; @@ -744,7 +752,10 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) User* user = useruid.empty() ? NULL : ServerInstance->FindNick(useruid); if (!valid) + { ServerInstance->Logs->Log("CONFIG",DEFAULT, "There were errors in your configuration file:"); + Classes.clear(); + } while (errstr.good()) { @@ -886,7 +897,7 @@ ConfigTag* ServerConfig::ConfValue(const std::string &tag) { ConfigTagList found = config_data.equal_range(tag); if (found.first == found.second) - return NULL; + return EmptyTag; ConfigTag* rv = found.first->second; found.first++; if (found.first != found.second) @@ -952,6 +963,7 @@ void ConfigReaderThread::Finish() * XXX: The order of these is IMPORTANT, do not reorder them without testing * thoroughly!!! */ + ServerInstance->Users->RehashCloneCounts(); ServerInstance->XLines->CheckELines(); ServerInstance->XLines->ApplyLines(); ServerInstance->Res->Rehash();