summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-03-03 15:45:22 -0500
committerAdam <Adam@anope.org>2015-03-21 12:53:21 -0400
commit7f051bcc5198c2eb3fff1ca52888bd7c6ec19000 (patch)
treecf87fa2bf76fad4e0d314e9efba82b44a4834643 /src
parentc85a46ff97c03b28bfb54578c5ff851f47af8419 (diff)
Rebuild clone counts on rehash
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp1
-rw-r--r--src/usermanager.cpp16
2 files changed, 17 insertions, 0 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index b3caf8c75..bcee938d5 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -963,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();
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index 1918b5c4c..76446c5b5 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -287,6 +287,22 @@ void UserManager::RemoveCloneCounts(User *user)
}
}
+void UserManager::RehashCloneCounts()
+{
+ local_clones.clear();
+ global_clones.clear();
+
+ const user_hash& hash = *ServerInstance->Users->clientlist;
+ for (user_hash::const_iterator i = hash.begin(); i != hash.end(); ++i)
+ {
+ User* u = i->second;
+
+ if (IS_LOCAL(u))
+ AddLocalClone(u);
+ AddGlobalClone(u);
+ }
+}
+
unsigned long UserManager::GlobalCloneCount(User *user)
{
clonemap::iterator x = global_clones.find(user->GetCIDRMask());