From a60b8e0d560404815a1587eb1d0f2b37f23db935 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 31 Oct 2007 21:09:35 +0000 Subject: More debug in here git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8446 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/xline.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/xline.cpp') diff --git a/src/xline.cpp b/src/xline.cpp index 3c1259eac..bfa6fe446 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -348,11 +348,10 @@ KLine* XLineManager::matches_kline(User* user) bool XLineManager::XSortComparison(const XLine *one, const XLine *two) { - // account for permanent lines + // account for permanent lines, move to bottom if (one->expiry == 0) - { return false; - } + return (one->expiry) < (two->expiry); } @@ -361,6 +360,8 @@ void XLineManager::expire_lines() { time_t current = ServerInstance->Time(); + ServerInstance->Log(DEBUG,"expire_lines() running. Time %ld active_lines.size() %u", current, active_lines.size()); + /* Because we now store all our XLines in sorted order using ((*i)->duration + (*i)->set_time) as a key, this * means that to expire the XLines we just need to do a while, picking off the top few until there are * none left at the head of the queue that are after the current time. @@ -368,6 +369,7 @@ void XLineManager::expire_lines() while ((active_lines.size()) && (current > (*active_lines.begin())->expiry) && ((*active_lines.begin())->duration != 0)) { + ServerInstance->Log(DEBUG,"Remove one"); std::vector::iterator i = active_lines.begin(); (*i)->DisplayExpiry(); (*i)->Unset(); @@ -382,6 +384,11 @@ void XLineManager::expire_lines() delete *i; } + + for (std::vector::iterator n = active_lines.begin(); n != active_lines.end(); n++) + { + ServerInstance->Log(DEBUG,"n->expiry=%ld n->duration=%ld", (*n)->expiry, (*n)->duration); + } } // applies lines, removing clients and changing nicks etc as applicable -- cgit v1.2.3