It compiles; ship it.

(add some sort of working skeleton for BanCacheManager::RemoveEntries().)

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8600 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
w00t 2007-11-17 23:59:39 +00:00
parent 409b55e442
commit 12ec2bc108

View File

@ -65,7 +65,36 @@ bool BanCacheManager::RemoveHit(BanCacheHit *b)
int BanCacheManager::RemoveEntries(const std::string &type, bool positive)
{
return 0;
int removed = 0;
BanCacheHash::iterator safei;
for (BanCacheHash::iterator n = BanHash->begin(); n != BanHash->end(); )
{
safei = n;
safei++;
BanCacheHit *b = n->second;
/* Safe to delete items here through iterator 'n' */
if (b->Type == type)
{
if ((positive && !b->Reason.empty()) || b->Reason.empty())
{
/* we need to remove this one. */
delete b;
b = NULL;
BanHash->erase(n);
removed++;
}
}
/* End of safe section */
n = safei;
}
return removed;
}
void BanCacheManager::RehashCache()