From: <los...@us...> - 2007-03-26 21:17:30
|
Revision: 567 http://svn.sourceforge.net/fail2ban/?rev=567&view=rev Author: lostcontrol Date: 2007-03-26 14:17:31 -0700 (Mon, 26 Mar 2007) Log Message: ----------- - Fixed "reload" bug. Many many thanks to Yaroslav Halchenko Modified Paths: -------------- trunk/CHANGELOG trunk/server/actions.py trunk/server/filter.py trunk/server/filtergamin.py trunk/server/filterpoll.py trunk/server/jail.py trunk/server/jailthread.py trunk/server/server.py Modified: trunk/CHANGELOG =================================================================== --- trunk/CHANGELOG 2007-03-26 21:08:09 UTC (rev 566) +++ trunk/CHANGELOG 2007-03-26 21:17:31 UTC (rev 567) @@ -10,6 +10,7 @@ ver. 0.?.? (2007/??/??) - ??? ---------- - Close opened handlers. Thanks to Yaroslav Halchenko +- Fixed "reload" bug. Many many thanks to Yaroslav Halchenko ver. 0.7.8 (2007/03/21) - release candidate ---------- Modified: trunk/server/actions.py =================================================================== --- trunk/server/actions.py 2007-03-26 21:08:09 UTC (rev 566) +++ trunk/server/actions.py 2007-03-26 21:17:31 UTC (rev 567) @@ -125,10 +125,10 @@ # @return True when the thread exits nicely def run(self): + self.setActive(True) for action in self.__actions: action.execActionStart() - self.setActive(True) - while self.isActive(): + while self._isActive(): if not self.getIdle(): #logSys.debug(self.jail.getName() + ": action") ret = self.__checkBan() Modified: trunk/server/filter.py =================================================================== --- trunk/server/filter.py 2007-03-26 21:08:09 UTC (rev 566) +++ trunk/server/filter.py 2007-03-26 21:17:31 UTC (rev 567) @@ -385,7 +385,7 @@ self.__setFilePos() lastLine = None for line in self.__crtHandler: - if not self.isActive(): + if not self._isActive(): # The jail has been stopped break try: Modified: trunk/server/filtergamin.py =================================================================== --- trunk/server/filtergamin.py 2007-03-26 21:08:09 UTC (rev 566) +++ trunk/server/filtergamin.py 2007-03-26 21:17:31 UTC (rev 567) @@ -99,7 +99,7 @@ def run(self): self.setActive(True) - while self.isActive(): + while self._isActive(): if not self.getIdle(): # We cannot block here because we want to be able to # exit. Modified: trunk/server/filterpoll.py =================================================================== --- trunk/server/filterpoll.py 2007-03-26 21:08:09 UTC (rev 566) +++ trunk/server/filterpoll.py 2007-03-26 21:17:31 UTC (rev 567) @@ -93,7 +93,7 @@ def run(self): self.setActive(True) - while self.isActive(): + while self._isActive(): if not self.getIdle(): # Get file modification for f in self.getLogPath(): Modified: trunk/server/jail.py =================================================================== --- trunk/server/jail.py 2007-03-26 21:08:09 UTC (rev 566) +++ trunk/server/jail.py 2007-03-26 21:17:31 UTC (rev 567) @@ -89,10 +89,10 @@ self.__filter.join() self.__action.join() - def isActive(self): - isActive0 = self.__filter.isActive() - isActive1 = self.__action.isActive() - return isActive0 or isActive1 + def isAlive(self): + isAlive0 = self.__filter.isAlive() + isAlive1 = self.__action.isAlive() + return isAlive0 or isAlive1 def setIdle(self, value): self.__filter.setIdle(value) Modified: trunk/server/jailthread.py =================================================================== --- trunk/server/jailthread.py 2007-03-26 21:08:09 UTC (rev 566) +++ trunk/server/jailthread.py 2007-03-26 21:17:31 UTC (rev 567) @@ -105,7 +105,7 @@ # Check if the filter thread is running. # @return True if the thread is running - def isActive(self): + def _isActive(self): return self.__isRunning ## Modified: trunk/server/server.py =================================================================== --- trunk/server/server.py 2007-03-26 21:08:09 UTC (rev 566) +++ trunk/server/server.py 2007-03-26 21:17:31 UTC (rev 567) @@ -96,7 +96,7 @@ def startJail(self, name): try: self.__lock.acquire() - if not self.isActive(name): + if not self.isAlive(name): self.__jails.get(name).start() finally: self.__lock.release() @@ -104,7 +104,7 @@ def stopJail(self, name): try: self.__lock.acquire() - if self.isActive(name): + if self.isAlive(name): self.__jails.get(name).stop() self.delJail(name) finally: @@ -118,8 +118,8 @@ finally: self.__lock.release() - def isActive(self, name): - return self.__jails.get(name).isActive() + def isAlive(self, name): + return self.__jails.get(name).isAlive() def setIdleJail(self, name, value): self.__jails.get(name).setIdle(value) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |