mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Misc
This commit is contained in:
@@ -163,14 +163,14 @@ namespace ArchiSteamFarm.IPC.Integration {
|
||||
await AuthorizationSemaphore.WaitAsync().ConfigureAwait(false);
|
||||
|
||||
try {
|
||||
if (FailedAuthorizations.TryGetValue(clientIP, out attempts)) {
|
||||
if (attempts >= MaxFailedAuthorizationAttempts) {
|
||||
return (HttpStatusCode.Forbidden, false);
|
||||
}
|
||||
bool hasFailedAuthorizations = FailedAuthorizations.TryGetValue(clientIP, out attempts);
|
||||
|
||||
if (hasFailedAuthorizations && (attempts >= MaxFailedAuthorizationAttempts)) {
|
||||
return (HttpStatusCode.Forbidden, false);
|
||||
}
|
||||
|
||||
if (!authorized) {
|
||||
FailedAuthorizations[clientIP] = FailedAuthorizations.TryGetValue(clientIP, out attempts) ? ++attempts : (byte) 1;
|
||||
FailedAuthorizations[clientIP] = hasFailedAuthorizations ? ++attempts : (byte) 1;
|
||||
}
|
||||
} finally {
|
||||
AuthorizationSemaphore.Release();
|
||||
|
||||
Reference in New Issue
Block a user