diff options
| author | 2023-01-08 16:12:43 +0000 | |
|---|---|---|
| committer | 2023-01-08 16:28:40 +0000 | |
| commit | 8831595e1a5306f4204fedc6ecbc4a3c9299fb35 (patch) | |
| tree | f9f27322d35d199240dfeca82415ec94724f2ff9 /src/configreader.cpp | |
| parent | Switch sqloper to use a local user lookup instead of IS_LOCAL. (diff) | |
Rework how users are assigned to connect classes.
- Move core connect class checks and <performance:clonesonconnect>
to the core_user module.
- Add pre-change and post-change events for when a connect class
changes.
- Split explicit class changing out into its own method.
- Remove the need to almost always call CheckClass after SetClass.
- Add use counting to the connect class instead of relying on the
shared_ptr use count.
Diffstat (limited to 'src/configreader.cpp')
| -rw-r--r-- | src/configreader.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 539901764..65df85bfd 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -152,7 +152,7 @@ void ServerConfig::CrossCheckOperBlocks() void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current) { - typedef std::map<std::pair<std::string, ConnectClass::Type>, ConnectClass::Ptr> ClassMap; + typedef std::map<std::pair<std::string, ConnectClass::Type>, std::shared_ptr<ConnectClass>> ClassMap; ClassMap oldBlocksByMask; if (current) { @@ -198,7 +198,7 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current) continue; } - ConnectClass::Ptr parent; + std::shared_ptr<ConnectClass> parent; std::string parentName = tag->getString("parent"); if (!parentName.empty()) { @@ -250,7 +250,7 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current) ClassMap::iterator oldMask = oldBlocksByMask.find(std::make_pair(mask, me->type)); if (oldMask != oldBlocksByMask.end()) { - ConnectClass::Ptr old = oldMask->second; + std::shared_ptr<ConnectClass> old = oldMask->second; oldBlocksByMask.erase(oldMask); old->Update(me); me = old; @@ -300,7 +300,6 @@ void ServerConfig::Fill() throw CoreException("You must restart to change the server id"); } SoftLimit = ConfValue("performance")->getUInt("softlimit", (SocketEngine::GetMaxFds() > 0 ? SocketEngine::GetMaxFds() : LONG_MAX), 10); - CCOnConnect = ConfValue("performance")->getBool("clonesonconnect", true); MaxConn = static_cast<int>(ConfValue("performance")->getUInt("somaxconn", SOMAXCONN)); TimeSkipWarn = ConfValue("performance")->getDuration("timeskipwarn", 2, 0, 30); XLineMessage = options->getString("xlinemessage", "You're banned!", 1); |
