src/Cedar/Listener.c
// Delete old entries from the DOS attack list

Delete old entries from the DOS attack list
Delete old entries from the DOS attack list
void RefreshDosList(LISTENER *r)
{
	if (r == NULL)
	{
		return;
	}
	if (r->DosListLastRefreshTime == 0 ||
		(r->DosListLastRefreshTime + (UINT64)DOS_TABLE_REFRESH_INTERVAL) <= Tick64())
	{
		UINT i;
		LIST *o;
		r->DosListLastRefreshTime = Tick64();
		o = NewListFast(NULL);
		for (i = 0;i < LIST_NUM(r->DosList);i++)
		{
			DOS *d = LIST_DATA(r->DosList, i);
			if ((d->LastConnectedTick + d->CurrentExpireSpan) <= Tick64() ||
				(d->DeleteEntryTick <= Tick64()))
			{
				Add(o, d);
			}
		}
		for (i = 0;i < LIST_NUM(o);i++)
		{
			DOS *d = LIST_DATA(o, i);
			Delete(r->DosList, d);
			Free(d);
		}
		ReleaseList(o);
	}
}
void RefreshDosList ( LISTENER * r ) { if ( r == NULL ) { return ; } if ( r -> DosListLastRefreshTime == 0 || ( r -> DosListLastRefreshTime + ( UINT64 ) DOS_TABLE_REFRESH_INTERVAL ) <= Tick64 ( ) ) { UINT i ; LIST * o ; r -> DosListLastRefreshTime = Tick64 ( ) ; o = NewListFast ( NULL ) ; for ( i = 0 ; i < LIST_NUM ( r -> DosList ) ; i ++ ) { DOS * d = LIST_DATA ( r -> DosList , i ) ; if ( ( d -> LastConnectedTick + d -> CurrentExpireSpan ) <= Tick64 ( ) || ( d -> DeleteEntryTick <= Tick64 ( ) ) ) { Add ( o , d ) ; } } for ( i = 0 ; i < LIST_NUM ( o ) ; i ++ ) { DOS * d = LIST_DATA ( o , i ) ; Delete ( r -> DosList , d ) ; Free ( d ) ; } ReleaseList ( o ) ; } }
Delete old entries from the DOS attack list
Delete old entries from the DOS attack list
// Validate arguments
