added: to 'ipban' winix function:

possibility to remove a ban (or all bans)
added: to SessionManager: sorting of the ban list (in the second thread)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@903 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-10-27 09:03:49 +00:00
parent 099dd55d0c
commit 9ef3736989
11 changed files with 113 additions and 9 deletions

View File

@@ -460,8 +460,16 @@ IPBan & SessionManager::GetIPBan(size_t index)
}
void SessionManager::RemoveIPBan(int ip)
{
ban_tab.RemoveIP(ip);
}
void SessionManager::ClearIPBanList()
{
ban_tab.Clear();
}
/*
@@ -488,6 +496,7 @@ SessionContainer::Iterator i;
{
Lock();
CheckWheterIPListIsSorted();
CheckSession(i);
exit = synchro->was_stop_signal;
@@ -496,6 +505,17 @@ SessionContainer::Iterator i;
}
// objects locked
void SessionManager::CheckWheterIPListIsSorted()
{
if( !ban_tab.IsSorted() )
{
log << log4 << "SM: sorting the ban list" << logend;
ban_tab.Sort();
}
}
// it's called from the other thread (with Lock and Unlock)
void SessionManager::CheckSession(SessionContainer::Iterator & i)
{