diff options
Diffstat (limited to 'src/bancache.cpp')
-rw-r--r-- | src/bancache.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bancache.cpp b/src/bancache.cpp index e8accb404..472685f08 100644 --- a/src/bancache.cpp +++ b/src/bancache.cpp @@ -77,6 +77,11 @@ unsigned int BanCacheManager::RemoveEntries(const std::string &type, bool positi BanCacheHash::iterator safei; + if (positive) + ServerInstance->Log(DEBUG, "BanCacheManager::RemoveEntries(): Removing positive hits for " + type); + else + ServerInstance->Log(DEBUG, "BanCacheManager::RemoveEntries(): Removing negative hits for " + type); + for (BanCacheHash::iterator n = BanHash->begin(); n != BanHash->end(); ) { safei = n; @@ -85,9 +90,9 @@ unsigned int BanCacheManager::RemoveEntries(const std::string &type, bool positi BanCacheHit *b = n->second; /* Safe to delete items here through iterator 'n' */ - if (b->Type == type) + if (b->Type == type || !positive) // if removing negative hits, ignore type.. { - if ((positive && !b->Reason.empty()) || !positive && b->Reason.empty()) + if ((positive && !b->Reason.empty()) || b->Reason.empty()) { /* we need to remove this one. */ ServerInstance->Log(DEBUG, "BanCacheManager::RemoveEntries(): Removing a hit on " + b->IP); |