]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Merge pull request #1271 from SaberUK/master+exemption
[user/henk/code/inspircd.git] / src / configreader.cpp
index 8a432e82f6a74f836038a4ebfdfb1627dd473196..8263b8737c6156a1eab556a3e55f8be30d69ddf7 100644 (file)
@@ -46,7 +46,7 @@ ServerLimits::ServerLimits(ConfigTag* tag)
 
 static ConfigTag* CreateEmptyTag()
 {
-       std::vector<KeyVal>* items;
+       ConfigItems* items;
        return ConfigTag::create("empty", "<auto>", 0, items);
 }
 
@@ -220,9 +220,9 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current)
        if (blk_count == 0)
        {
                // No connect blocks found; make a trivial default block
-               std::vector<KeyVal>* items;
+               ConfigItems* items;
                ConfigTag* tag = ConfigTag::create("connect", "<auto>", 0, items);
-               items->push_back(std::make_pair("allow", "*"));
+               (*items)["allow"] = "*";
                config_data.insert(std::make_pair("connect", tag));
                blk_count = 1;
        }
@@ -328,6 +328,14 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current)
                        me->limit = tag->getInt("limit", me->limit);
                        me->resolvehostnames = tag->getBool("resolvehostnames", me->resolvehostnames);
 
+                       std::string ports = tag->getString("port");
+                       if (!ports.empty())
+                       {
+                               irc::portparser portrange(ports, false);
+                               while (int port = portrange.GetToken())
+                                       me->ports.insert(port);
+                       }
+
                        ClassMap::iterator oldMask = oldBlocksByMask.find(typeMask);
                        if (oldMask != oldBlocksByMask.end())
                        {
@@ -362,13 +370,13 @@ struct DeprecatedConfig
 static const DeprecatedConfig ChangedConfig[] = {
        { "bind",        "transport",   "",                 "has been moved to <bind:ssl> as of 2.0" },
        { "die",         "value",       "",                 "you need to reread your config" },
-       { "gnutls",      "starttls",    "",                 "has been replaced with m_starttls as of 2.2" },
+       { "gnutls",      "starttls",    "",                 "has been replaced with m_starttls as of 3.0" },
        { "link",        "autoconnect", "",                 "2.0+ does not use this attribute - define <autoconnect> tags instead" },
        { "link",        "transport",   "",                 "has been moved to <link:ssl> as of 2.0" },
-       { "module",      "name",        "m_chanprotect.so", "has been replaced with m_customprefix as of 2.2" },
-       { "module",      "name",        "m_halfop.so",      "has been replaced with m_customprefix as of 2.2" },
-       { "options",     "cyclehosts",  "",                 "has been replaced with m_hostcycle as of 2.2" },
-       { "performance", "nouserdns",   "",                 "has been moved to <connect:resolvehostnames> as of 2.2" }
+       { "module",      "name",        "m_chanprotect.so", "has been replaced with m_customprefix as of 3.0" },
+       { "module",      "name",        "m_halfop.so",      "has been replaced with m_customprefix as of 3.0" },
+       { "options",     "cyclehosts",  "",                 "has been replaced with m_hostcycle as of 3.0" },
+       { "performance", "nouserdns",   "",                 "has been moved to <connect:resolvehostnames> as of 3.0" }
 };
 
 void ServerConfig::Fill()
@@ -433,11 +441,11 @@ void ServerConfig::Fill()
                throw CoreException(Network + " is not a valid network name. A network name must not contain spaces.");
 
        std::string defbind = options->getString("defaultbind");
-       if (assign(defbind) == "ipv4")
+       if (stdalgo::string::equalsci(defbind, "ipv4"))
        {
                WildcardIPv6 = false;
        }
-       else if (assign(defbind) == "ipv6")
+       else if (stdalgo::string::equalsci(defbind, "ipv6"))
        {
                WildcardIPv6 = true;
        }