]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Merge pull request #1018 from SaberUK/insp20+hidekills
[user/henk/code/inspircd.git] / src / configreader.cpp
index 7d204bfb7bda0c9839ae26c4f1ab32b62a029ce8..bcee938d55208e1aefc3dcc5d0db93cf81820175 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()
@@ -554,7 +563,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>");
@@ -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();