fix: Exempts localhost from IPLimiter. Preps testing for io_uring (#2316)
### Summary * Exempts localhost from IPLimiter * Updates tests to have proper sequential testing with packets * Updates tests to clean up NetState
This commit is contained in:
parent
8133983b64
commit
1e4c32c809
77 changed files with 4612 additions and 4616 deletions
|
|
@ -56,6 +56,12 @@ public class IPRateLimiter
|
|||
|
||||
public bool Verify(IPAddress ip, out int totalAttempts)
|
||||
{
|
||||
if (ip.IsPrivateNetwork())
|
||||
{
|
||||
totalAttempts = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
var nowTicks = Core.TickCount;
|
||||
var ipStats = _ipAttempts.GetOrAdd(ip, _ => GetOrCreateIPStats());
|
||||
var added = ipStats.AttemptCount == 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue