refine rptl

api
Simon 3 years ago
parent dd79311f7a
commit 83c0ff9420

@ -218,8 +218,10 @@ class Proxy(DatagramProtocol):
self.rptlTrack[host] += 1 self.rptlTrack[host] += 1
if self.rptlTrack[host] > 20: if self.rptlTrack[host] > 20:
print('(RPTL) exceeded max: {}'.format(self.rptlTrack[host]))
_bltime = nowtime + 600 _bltime = nowtime + 600
self.IPBlackList[host] = _bltime self.IPBlackList[host] = _bltime
self.rptlTrack.pop(host)
if self.clientinfo: if self.clientinfo:
print('(RPTL) Add to blacklist: host {}. Expire time {}'.format(host,_bltime)) print('(RPTL) Add to blacklist: host {}. Expire time {}'.format(host,_bltime))
@ -438,6 +440,7 @@ if __name__ == '__main__':
print('Purge RPTL table') print('Purge RPTL table')
if Stats == True: if Stats == True:
stats_task = task.LoopingCall(stats) stats_task = task.LoopingCall(stats)
statsa = stats_task.start(30) statsa = stats_task.start(30)

Loading…
Cancel
Save

Powered by TurnKey Linux.