updating existing bans' expiration would break ordering in bans sorted list

This commit is contained in:
eeeee 2011-12-14 13:48:41 +01:00
parent 0c16a58563
commit 385be8a716

View file

@ -174,15 +174,11 @@ int CNetServer::BanAdd(NETADDR Addr, int Seconds, const char *pReason)
if(Seconds)
Stamp = time_timestamp() + Seconds;
// search to see if it already exists
// search to remove it if it already exists
pBan = m_aBans[IpHash];
MACRO_LIST_FIND(pBan, m_pHashNext, net_addr_comp(&pBan->m_Info.m_Addr, &Addr) == 0);
if(pBan)
{
// adjust the ban
pBan->m_Info.m_Expires = Stamp;
return 0;
}
BanRemoveByObject(pBan);
if(!m_BanPool_FirstFree)
return -1;