summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-05-20 21:10:49 -0400
committerAdam <Adam@anope.org>2014-05-20 21:16:00 -0400
commit866f3f32ab3713e9867747f150df3698e456744e (patch)
tree20aabb18d88ee72a4fd412e17ebe30585496bd97 /src/users.cpp
parent20ce170024779aebbc1462146905c976836a552f (diff)
Speed up akill xline checks
Cache xline nick, user, host, etc instead of rebuilding it everytime its requested. Store users ip in sockaddr form and not string form to prevent having to rebuild sockaddrs when checking xlines. Also do not try to convert empty config values in Config::Get as this can be rather common if a non string configuration value is not set, and the cost of the ConvertException is great.
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 94ab75fb4..8a4246e2f 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -33,7 +33,7 @@ time_t MaxUserTime = 0;
std::list<User *> User::quitting_users;
-User::User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *account)
+User::User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &uip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *account) : ip(uip)
{
if (snick.empty() || sident.empty() || shost.empty())
throw CoreException("Bad args passed to User::User");
@@ -49,7 +49,6 @@ User::User(const Anope::string &snick, const Anope::string &sident, const Anope:
this->host = shost;
this->vhost = svhost;
this->chost = svhost;
- this->ip = sip;
this->server = sserver;
this->realname = srealname;
this->timestamp = this->signon = ts;
@@ -72,7 +71,7 @@ User::User(const Anope::string &snick, const Anope::string &sident, const Anope:
{
++sserver->users;
if (server->IsSynced())
- Log(this, "connect") << (!vhost.empty() && vhost != host ? "(" + vhost + ") " : "") << "(" << srealname << ") " << (!sip.empty() && sip != host ? "[" + sip + "] " : "") << "connected to the network (" << sserver->GetName() << ")";
+ Log(this, "connect") << (!vhost.empty() && vhost != host ? "(" + vhost + ") " : "") << "(" << srealname << ") " << (!uip.empty() && uip != host ? "[" + uip + "] " : "") << "connected to the network (" << sserver->GetName() << ")";
}
if (UserListByNick.size() > MaxUserCount)