summaryrefslogtreecommitdiff
path: root/modules/commands/os_defcon.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 /modules/commands/os_defcon.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 'modules/commands/os_defcon.cpp')
-rw-r--r--modules/commands/os_defcon.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp
index afd5dc7d6..c5074fd44 100644
--- a/modules/commands/os_defcon.cpp
+++ b/modules/commands/os_defcon.cpp
@@ -502,7 +502,7 @@ class OSDefcon : public Module
if (DConfig.sessionlimit <= 0 || !session_service)
return;
- Session *session = session_service->FindSession(u->ip);
+ Session *session = session_service->FindSession(u->ip.addr());
Exception *exception = session_service->FindException(u);
if (DConfig.Check(DEFCON_REDUCE_SESSION) && !exception)
@@ -511,7 +511,7 @@ class OSDefcon : public Module
{
if (!DConfig.sle_reason.empty())
{
- Anope::string message = DConfig.sle_reason.replace_all_cs("%IP%", u->ip);
+ Anope::string message = DConfig.sle_reason.replace_all_cs("%IP%", u->ip.addr());
u->SendMessage(OperServ, message);
}
if (!DConfig.sle_detailsloc.empty())