mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 19:19:02 -04:00
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:
parent
409b55e442
commit
12ec2bc108
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user