summaryrefslogtreecommitdiff
path: root/src/users.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/users.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/users.cpp')
-rw-r--r--src/users.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 58c105047..c2cda4aea 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -239,12 +239,16 @@ User::User(const std::string &uid, const std::string& sid, int type)
throw CoreException("Duplicate UUID "+std::string(uuid)+" in User constructor");
}
-LocalUser::LocalUser() : User(ServerInstance->GetUID(), ServerInstance->Config->ServerName, USERTYPE_LOCAL)
+LocalUser::LocalUser(int myfd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* servaddr)
+ : User(ServerInstance->GetUID(), ServerInstance->Config->ServerName, USERTYPE_LOCAL)
{
bytes_in = bytes_out = cmds_in = cmds_out = 0;
server_sa.sa.sa_family = AF_UNSPEC;
Penalty = 0;
lastping = nping = 0;
+ SetFd(myfd);
+ memcpy(&client_sa, client, sizeof(irc::sockets::sockaddrs));
+ memcpy(&server_sa, servaddr, sizeof(irc::sockets::sockaddrs));
}
User::~User()
@@ -588,6 +592,9 @@ CullResult User::cull()
this->InvalidateCache();
this->DecrementModes();
+ if (client_sa.sa.sa_family != AF_UNSPEC)
+ ServerInstance->Users->RemoveCloneCounts(this);
+
ServerInstance->Users->uuidlist->erase(uuid);
return Extensible::cull();
}
@@ -600,8 +607,6 @@ CullResult LocalUser::cull()
else
ServerInstance->Logs->Log("USERS", DEBUG, "Failed to remove user from vector");
- if (client_sa.sa.sa_family != AF_UNSPEC)
- ServerInstance->Users->RemoveCloneCounts(this);
Close();
return User::cull();
}