Browse Source

- Fixes in locking

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@366 a942ae1a-1317-0410-a47c-b1dcaea8d605
0.x
Cyril Jaquier 18 years ago
parent
commit
acb2fc2c2b
  1. 4
      server/banmanager.py
  2. 2
      server/jail.py

4
server/banmanager.py

@ -110,16 +110,12 @@ class BanManager:
@staticmethod
def createBanTicket(ticket):
try:
self.lock.acquire()
ip = ticket.getIP()
#lastTime = ticket.getTime()
lastTime = time.time()
banTicket = BanTicket(ip, lastTime)
banTicket.setAttempt(ticket.getAttempt())
return banTicket
finally:
self.lock.release()
##
# Add a ban ticket.

2
server/jail.py

@ -91,9 +91,9 @@ class Jail:
self.lock.release()
def getFailTicket(self):
try:
try:
self.lock.acquire()
try:
return self.queue.get(False)
except Queue.Empty:
return False

Loading…
Cancel
Save