summaryrefslogtreecommitdiff
path: root/modules/commands/os_defcon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/os_defcon.cpp')
-rw-r--r--modules/commands/os_defcon.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp
index 7e40a5c02..3bd1fc111 100644
--- a/modules/commands/os_defcon.cpp
+++ b/modules/commands/os_defcon.cpp
@@ -549,13 +549,17 @@ class OSDefcon : public Module
if (!Config->SessionLimitDetailsLoc.empty())
ircdproto->SendMessage(findbot(Config->OperServ), u->nick, "%s", Config->SessionLimitDetailsLoc.c_str());
- u->Kill(Config->OperServ, "Defcon session limit exceeded");
++session->hits;
if (akills && Config->MaxSessionKill && session->hits >= Config->MaxSessionKill)
{
XLine x("*@" + u->host, Config->OperServ, Anope::CurTime + Config->SessionAutoKillExpiry, "Defcon session limit exceeded", XLineManager::GenerateUID());
akills->Send(NULL, &x);
- ircdproto->SendGlobops(findbot(Config->OperServ), "[DEFCON] Added a temporary AKILL for \2*@%s\2 due to excessive connections", u->host.c_str());
+ Log(findbot(Config->OperServ), "akill/defcon") << "[DEFCON] Added a temporary AKILL for \2*@" << u->host << "\2 due to excessive connections";
+ }
+ else
+ {
+ u->Kill(Config->OperServ, "Defcon session limit exceeded");
+ u = NULL; /* No guarentee u still exists */
}
}
}