mirror of https://github.com/fail2ban/fail2ban
- Removed useless code
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@423 a942ae1a-1317-0410-a47c-b1dcaea8d6050.x
parent
3cd43b13ce
commit
2f37284863
|
@ -30,7 +30,7 @@ from jailthread import JailThread
|
||||||
from datedetector import DateDetector
|
from datedetector import DateDetector
|
||||||
from mytime import MyTime
|
from mytime import MyTime
|
||||||
|
|
||||||
import time, logging, re
|
import logging, re
|
||||||
|
|
||||||
# Gets the instance of the logger.
|
# Gets the instance of the logger.
|
||||||
logSys = logging.getLogger("fail2ban.filter")
|
logSys = logging.getLogger("fail2ban.filter")
|
||||||
|
@ -356,13 +356,10 @@ class Filter(JailThread):
|
||||||
lastLine = None
|
lastLine = None
|
||||||
for line in self.__crtHandler:
|
for line in self.__crtHandler:
|
||||||
try:
|
try:
|
||||||
# Try to convert UTF-8 string to Latin-1
|
# Decode line to UTF-8
|
||||||
#line = line.decode('utf-8').encode('latin-1')
|
|
||||||
line = line.decode('utf-8')
|
line = line.decode('utf-8')
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
pass
|
pass
|
||||||
#except UnicodeEncodeError:
|
|
||||||
# logSys.warn("Mmhh... Are you sure you watch the correct file?")
|
|
||||||
if not self.dateDetector.matchTime(line):
|
if not self.dateDetector.matchTime(line):
|
||||||
# There is no valid time in this line
|
# There is no valid time in this line
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue