diff options
author | Peter Powell <petpow@saberuk.com> | 2017-07-30 17:44:53 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-07-30 18:27:30 +0100 |
commit | 0b60166d8a9ca1c461f014b9dcb03312f2e487d7 (patch) | |
tree | 8d60a7ac3365912c6ac1432a9708860ec5d201ba /src | |
parent | f29e1fa2b58796674f5d047456b38cc5b4de41d6 (diff) |
Fix the server failing to rehash when <server:name> is unset.
Diffstat (limited to 'src')
-rw-r--r-- | src/configreader.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 8aa19d6d6..d29ad8cef 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -383,21 +383,23 @@ void ServerConfig::Fill() { ConfigTag* options = ConfValue("options"); ConfigTag* security = ConfValue("security"); + ConfigTag* server = ConfValue("server"); if (sid.empty()) { - ServerName = ConfValue("server")->getString("name", "irc.example.com"); + ServerName = server->getString("name", "irc.example.com"); ValidHost(ServerName, "<server:name>"); - sid = ConfValue("server")->getString("id"); + sid = server->getString("id"); if (!sid.empty() && !InspIRCd::IsSID(sid)) throw CoreException(sid + " is not a valid server ID. A server ID must be 3 characters long, with the first character a digit and the next two characters a digit or letter."); } else { - if (ServerName != ConfValue("server")->getString("name")) + std::string name = server->getString("name"); + if (!name.empty() && name != ServerName) throw CoreException("You must restart to change the server name"); - std::string nsid = ConfValue("server")->getString("id"); + std::string nsid = server->getString("id"); if (!nsid.empty() && nsid != sid) throw CoreException("You must restart to change the server id"); } @@ -405,8 +407,8 @@ void ServerConfig::Fill() CCOnConnect = ConfValue("performance")->getBool("clonesonconnect", true); MaxConn = ConfValue("performance")->getInt("somaxconn", SOMAXCONN); XLineMessage = options->getString("xlinemessage", options->getString("moronbanner", "You're banned!")); - ServerDesc = ConfValue("server")->getString("description", "Configure Me"); - Network = ConfValue("server")->getString("network", "Network"); + ServerDesc = server->getString("description", "Configure Me"); + Network = server->getString("network", "Network"); NetBufferSize = ConfValue("performance")->getInt("netbuffersize", 10240, 1024, 65534); dns_timeout = ConfValue("dns")->getInt("timeout", 5); DisabledCommands = ConfValue("disabled")->getString("commands", ""); |