diff options
author | Adam <Adam@anope.org> | 2014-05-20 21:10:49 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-05-20 21:16:00 -0400 |
commit | 866f3f32ab3713e9867747f150df3698e456744e (patch) | |
tree | 20aabb18d88ee72a4fd412e17ebe30585496bd97 /include/xline.h | |
parent | 20ce170024779aebbc1462146905c976836a552f (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 'include/xline.h')
-rw-r--r-- | include/xline.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/xline.h b/include/xline.h index fa3f5ba6c..2eae08dc8 100644 --- a/include/xline.h +++ b/include/xline.h @@ -12,12 +12,15 @@ #include "serialize.h" #include "service.h" +#include "sockets.h" /* An Xline, eg, anything added with operserv/akill, or any of the operserv/sxline commands */ class CoreExport XLine : public Serializable { - void InitRegex(); + void Init(); + Anope::string nick, user, host, real; public: + cidr *c; Anope::string mask; Regex *regex; Anope::string by; @@ -32,10 +35,10 @@ class CoreExport XLine : public Serializable XLine(const Anope::string &mask, const Anope::string &by, const time_t expires, const Anope::string &reason, const Anope::string &uid = ""); ~XLine(); - Anope::string GetNick() const; - Anope::string GetUser() const; - Anope::string GetHost() const; - Anope::string GetReal() const; + const Anope::string &GetNick() const; + const Anope::string &GetUser() const; + const Anope::string &GetHost() const; + const Anope::string &GetReal() const; Anope::string GetReason() const; |