From 866f3f32ab3713e9867747f150df3698e456744e Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 20 May 2014 21:10:49 -0400 Subject: 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. --- include/xline.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include/xline.h') 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; -- cgit