From f3f443f085e922fa2bb5393c46d02722ad05879d Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 30 Dec 2014 20:51:34 +0100 Subject: Fix signon time of clients being off by dns_timeout seconds --- src/usermanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/usermanager.cpp') diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 076277a33..1918b5c4c 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -72,7 +72,7 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs (*(this->clientlist))[New->nick] = New; New->registered = REG_NONE; - New->signon = ServerInstance->Time() + ServerInstance->Config->dns_timeout; + New->signon = ServerInstance->Time(); New->lastping = 1; ServerInstance->Users->AddLocalClone(New); -- cgit v1.2.3 From 7f051bcc5198c2eb3fff1ca52888bd7c6ec19000 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 3 Mar 2015 15:45:22 -0500 Subject: Rebuild clone counts on rehash --- include/usermanager.h | 4 ++++ src/configreader.cpp | 1 + src/usermanager.cpp | 16 ++++++++++++++++ 3 files changed, 21 insertions(+) (limited to 'src/usermanager.cpp') diff --git a/include/usermanager.h b/include/usermanager.h index ac8ae1cb3..2a9d6b47b 100644 --- a/include/usermanager.h +++ b/include/usermanager.h @@ -112,6 +112,10 @@ class CoreExport UserManager */ void RemoveCloneCounts(User *user); + /** Rebuild clone counts + */ + void RehashCloneCounts(); + /** Return the number of global clones of this user * @param user The user to get a count for * @return The global clone count of this user 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()); -- cgit v1.2.3