]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Merge pull request #1162 from SaberUK/insp20+fix-deinstall
[user/henk/code/inspircd.git] / src / configreader.cpp
index 2577b83b800f6719fd93ef3eb71bfbd71c6468af..5b298ddd8066b6ae00e2ac7f3fd124504ea3fede 100644 (file)
@@ -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<KeyVal>* items;
+       EmptyTag = ConfigTag::create("empty", "<auto>", 0, items);
+}
+
+ServerConfig::~ServerConfig()
+{
+       delete EmptyTag;
 }
 
 void ServerConfig::Update005()
@@ -522,6 +531,7 @@ void ServerConfig::Fill()
        HideBans = security->getBool("hidebans");
        HideWhoisServer = security->getString("hidewhois");
        HideKillsServer = security->getString("hidekills");
+       HideULineKills = security->getBool("hideulinekills");
        RestrictBannedUsers = security->getBool("restrictbannedusers", true);
        GenericOper = security->getBool("genericoper");
        NoUserDns = ConfValue("performance")->getBool("nouserdns");
@@ -554,7 +564,8 @@ void ServerConfig::Fill()
        WelcomeNotice = options->getBool("welcomenotice", true);
 
        range(SoftLimit, 10, ServerInstance->SE->GetMaxFds(), ServerInstance->SE->GetMaxFds(), "<performance:softlimit>");
-       range(MaxConn, 0, SOMAXCONN, SOMAXCONN, "<performance:somaxconn>");
+       if (ConfValue("performance")->getBool("limitsomaxconn", true))
+               range(MaxConn, 0, SOMAXCONN, SOMAXCONN, "<performance:somaxconn>");
        range(MaxTargets, 1, 31, 20, "<security:maxtargets>");
        range(NetBufferSize, 1024, 65534, 10240, "<performance:netbuffersize>");
        range(WhoWasGroupSize, 0, 10000, 10, "<whowas:groupsize>");
@@ -720,7 +731,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;
@@ -742,7 +753,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())
        {
@@ -884,7 +898,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)
@@ -950,6 +964,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();