diff options
| author | 2017-07-30 17:34:05 +0100 | |
|---|---|---|
| committer | 2017-09-08 20:11:50 +0100 | |
| commit | 51a47e7d757df63370168ab5000d13ca9c349ecd (patch) | |
| tree | 52db2b2e585988b27f1ba7c26792208f323bc610 /src/configreader.cpp | |
| parent | Move RPL_SYNTAX to 650 to prevent a collision with RPL_TEXT. (diff) | |
Implement support for configurable casemapping & default to ASCII.
Diffstat (limited to 'src/configreader.cpp')
| -rw-r--r-- | src/configreader.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index f29356c0c..696035a74 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -400,6 +400,14 @@ void ServerConfig::Fill() 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."); + + CaseMapping = options->getString("casemapping", "rfc1459"); + if (CaseMapping == "ascii") + national_case_insensitive_map = ascii_case_insensitive_map; + else if (CaseMapping == "rfc1459") + national_case_insensitive_map = rfc_case_insensitive_map; + else + throw CoreException("<options:casemapping> must be set to 'ascii', or 'rfc1459'"); } else { @@ -410,6 +418,11 @@ void ServerConfig::Fill() std::string nsid = server->getString("id"); if (!nsid.empty() && nsid != sid) throw CoreException("You must restart to change the server id"); + + std::string casemapping = options->getString("casemapping"); + if (!casemapping.empty() && casemapping != CaseMapping) + throw CoreException("You must restart to change the server casemapping"); + } SoftLimit = ConfValue("performance")->getInt("softlimit", (SocketEngine::GetMaxFds() > 0 ? SocketEngine::GetMaxFds() : LONG_MAX), 10); CCOnConnect = ConfValue("performance")->getBool("clonesonconnect", true); |
