summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-16 07:59:09 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-16 07:59:09 +0000
commit1963fba97f107f73fa825b22e9ae5a027f5292d9 (patch)
tree4d8dd787804a68ffef42f90fbac8b00a708017b8 /src/users.cpp
parentb7a990e474461921f79b0b8846fcb338dd18982c (diff)
Hacked-up culllist: stores user pointers rather than CullItem, as creating them seems to be very expensive and wasteful. Doesn't support silent quits (yet), and User::QuitUser seems to trigger *many* times per user before they are removed (socketengine getting write events to closed socket perhaps). It's still much quicker than the old way (NO perceptible lag AT ALL :))
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8714 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/users.cpp b/src/users.cpp
index d7671de3c..1d2b16dee 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -196,7 +196,7 @@ User::User(InspIRCd* Instance, const std::string &uid) : ServerInstance(Instance
memset(modes,0,sizeof(modes));
memset(snomasks,0,sizeof(snomasks));
/* Invalidate cache */
- operquit = cached_fullhost = cached_hostip = cached_makehost = cached_fullrealhost = NULL;
+ cached_fullhost = cached_hostip = cached_makehost = cached_fullrealhost = NULL;
if (uid.empty())
strlcpy(uuid, Instance->GetUID().c_str(), UUID_LENGTH);
@@ -228,8 +228,7 @@ User::~User()
this->InvalidateCache();
this->DecrementModes();
- if (operquit)
- free(operquit);
+
if (ip)
{
ServerInstance->Users->RemoveCloneCounts(this);
@@ -710,7 +709,9 @@ void User::QuitUser(InspIRCd* Instance, User *user, const std::string &quitreaso
Instance->Log(DEBUG,"QuitUser: %s '%s'", user->nick, quitreason.c_str());
user->Write("ERROR :Closing link (%s@%s) [%s]", user->ident, user->host, *operreason ? operreason : quitreason.c_str());
user->muted = true;
- Instance->GlobalCulls.AddItem(user, quitreason.c_str(), operreason);
+ user->quitmsg = quitreason;
+ user->operquitmsg = operreason;
+ Instance->GlobalCulls.AddItem(user);
}
/* adds or updates an entry in the whowas list */
@@ -1736,15 +1737,12 @@ void User::HandleEvent(EventType et, int errornum)
void User::SetOperQuit(const std::string &oquit)
{
- if (operquit)
- return;
-
- operquit = strdup(oquit.c_str());
+ operquitmsg = oquit;
}
const char* User::GetOperQuit()
{
- return operquit ? operquit : "";
+ return operquitmsg.c_str();
}
void User::IncreasePenalty(int increase)