summaryrefslogtreecommitdiff
path: root/src/usermanager.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-01 21:53:47 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-01 21:53:47 +0000
commit18ab1f358acd2ccdd2f95054ec56b83f17f18ddd (patch)
treefa4134b463e810124ed0de5a53eab6f80cd956bb /src/usermanager.cpp
parent9e110fbd1db97d382efb1c2e2448fcd874e7e47b (diff)
Fix global clone count not being decremented on remote user quit
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11984 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r--src/usermanager.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index f620a264d..05f5d2c9d 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -24,7 +24,7 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs
LocalUser* New = NULL;
try
{
- New = new LocalUser();
+ New = new LocalUser(socket, client, server);
}
catch (...)
{
@@ -33,10 +33,6 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs
return;
}
- New->SetFd(socket);
- memcpy(&New->client_sa, client, sizeof(irc::sockets::sockaddrs));
- memcpy(&New->server_sa, server, sizeof(irc::sockets::sockaddrs));
-
/* Give each of the modules an attempt to hook the user for I/O */
FOREACH_MOD(I_OnHookIO, OnHookIO(New, via));
@@ -56,10 +52,9 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs
this->unregistered_count++;
- (*(this->clientlist))[New->uuid] = New;
-
/* The users default nick is their UUID */
New->nick.assign(New->uuid, 0, ServerInstance->Config->Limits.NickMax);
+ (*(this->clientlist))[New->nick] = New;
New->ident.assign("unknown");
@@ -271,13 +266,16 @@ void UserManager::AddGlobalClone(User *user)
void UserManager::RemoveCloneCounts(User *user)
{
- clonemap::iterator x = local_clones.find(user->GetCIDRMask());
- if (x != local_clones.end())
+ if (IS_LOCAL(user))
{
- x->second--;
- if (!x->second)
+ clonemap::iterator x = local_clones.find(user->GetCIDRMask());
+ if (x != local_clones.end())
{
- local_clones.erase(x);
+ x->second--;
+ if (!x->second)
+ {
+ local_clones.erase(x);
+ }
}
}