summaryrefslogtreecommitdiff
path: root/security.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-17 15:19:31 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-17 15:19:31 -0300
commitbf1a8bba6bffe7f3a24c812442388c82ed343246 (patch)
tree1f5c99bbe75c43ecfdf5d7b164b8ef4687375ce8 /security.py
parentae57d4024596e3e26381b14bd556574c9a69ce1e (diff)
downloadserver-bf1a8bba6bffe7f3a24c812442388c82ed343246.tar.gz
server-bf1a8bba6bffe7f3a24c812442388c82ed343246.tar.bz2
server-bf1a8bba6bffe7f3a24c812442388c82ed343246.tar.xz
server-bf1a8bba6bffe7f3a24c812442388c82ed343246.zip
Remove some clutter print messages
Diffstat (limited to 'security.py')
-rw-r--r--security.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/security.py b/security.py
index 52c211d..44fdf80 100644
--- a/security.py
+++ b/security.py
@@ -72,7 +72,7 @@ def is_banned(ip):
def ban_ip(ip, until=INT_MAX):
global blacklist
blacklist.append([ip, until])
- print("%s has been banned until %d." % (ip, until))
+ stdout("%s has been banned until %d." % (ip, until))
return
def score(conn, score):
@@ -80,14 +80,11 @@ def score(conn, score):
conn.MS_score += score
limit = ifte(conn.MS_auth, 30, 5)
- print("Limit: %d" % limit)
- print("Score: %d" % conn.MS_score)
if (conn.MS_score >= limit):
stdout("Banning %s (%d/%d lame)" % (conn.address[0], conn.MS_score, limit))
ban_ip(conn.address[0], now()+BAN_TIME)
time.sleep(0.1)
- print("Closing connection!")
try:
conn.close(status=1000, reason="K-Lined")
except:
@@ -95,7 +92,7 @@ def score(conn, score):
print("Failed to close, retrying...")
try:
conn.close(conn, status=1000, reason="K-Lined")
- print("Connection closed!")
+ stdout("Connection closed!")
except:
traceback.print_exc()
print("Still failed! Connection was kept alive.")