From f5e34251d3e85d1e3cee23b418dc17e4b6cca3b3 Mon Sep 17 00:00:00 2001 From: w00t Date: Tue, 27 Jan 2009 13:21:47 +0000 Subject: Check line expiry when touching an xline, to prevent huge buildup of stale lines chomping CPU. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11007 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/xline.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/xline.cpp') diff --git a/src/xline.cpp b/src/xline.cpp index c696e7a3a..25987e0a2 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -261,20 +261,17 @@ XLine* XLineManager::MatchesLine(const std::string &type, User* user) safei = i; safei++; + if (i->second->duration && current > i->second->expiry) + { + /* Expire the line, proceed to next one */ + ExpireLine(x, i); + i = safei; + continue; + } + if (i->second->Matches(user)) { - if (i->second->duration && current > i->second->expiry) - { - /* Expire the line, return nothing */ - ExpireLine(x, i); - /* Continue, there may be another that matches - * (thanks aquanight) - */ - i = safei; - continue; - } - else - return i->second; + return i->second; } i = safei; -- cgit v1.2.3