small optimization for manually (via client / protocol) signaled attempt (performBan only if maxretry gets reached)

pull/2689/head
sebres 2020-03-13 18:03:27 +01:00
parent 9f1c6f1617
commit 68f827e1f3
1 changed files with 3 additions and 3 deletions

View File

@ -457,9 +457,9 @@ class Filter(JailThread):
logSys.info( logSys.info(
"[%s] Attempt %s - %s", self.jailName, ip, datetime.datetime.fromtimestamp(unixTime).strftime("%Y-%m-%d %H:%M:%S") "[%s] Attempt %s - %s", self.jailName, ip, datetime.datetime.fromtimestamp(unixTime).strftime("%Y-%m-%d %H:%M:%S")
) )
self.failManager.addFailure(ticket, len(matches) or 1) attempts = self.failManager.addFailure(ticket, len(matches) or 1)
# Perform the ban if this attempt is resulted to: # Perform the ban if this attempt is resulted to:
if attempts >= self.failManager.getMaxRetry():
self.performBan(ip) self.performBan(ip)
return 1 return 1