From 64fec23cc76f86650860a24e5dae1d49e27f9111 Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 6 Jan 2008 01:31:43 +0000 Subject: Add removal of BanCache entries on XLINE add/del, so we avoid out of date responses. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8641 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/bancache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/bancache.cpp') diff --git a/src/bancache.cpp b/src/bancache.cpp index 24578b379..e8accb404 100644 --- a/src/bancache.cpp +++ b/src/bancache.cpp @@ -87,9 +87,10 @@ unsigned int BanCacheManager::RemoveEntries(const std::string &type, bool positi /* Safe to delete items here through iterator 'n' */ if (b->Type == type) { - if ((positive && !b->Reason.empty()) || b->Reason.empty()) + if ((positive && !b->Reason.empty()) || !positive && b->Reason.empty()) { /* we need to remove this one. */ + ServerInstance->Log(DEBUG, "BanCacheManager::RemoveEntries(): Removing a hit on " + b->IP); delete b; b = NULL; BanHash->erase(n); // WORD TO THE WISE: don't use RemoveHit here, because we MUST remove the iterator in a safe way. -- cgit v1.3.1-10-gc9f91