From d7eb9071a0c06238d78fc69cb4e21855823e1ed9 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Wed, 7 Mar 2018 17:04:48 +0700 Subject: Shrink socket hardcoded msg lengths to 7 --- brutalmaze/game.py | 6 +++--- wiki | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/brutalmaze/game.py b/brutalmaze/game.py index 95d782c..affc4c0 100644 --- a/brutalmaze/game.py +++ b/brutalmaze/game.py @@ -258,13 +258,13 @@ class Game: self.maze.reinit() while True: if self.hero.dead: - connection.send('00000000'.encode()) + connection.send('0000000'.encode()) break data = self.export() - connection.send('{:08}'.format(len(data)).encode()) + connection.send('{:07}'.format(len(data)).encode()) connection.send(data) try: - buf = connection.recv(8) + buf = connection.recv(7) except: # client is likely to be closed break if not buf: break diff --git a/wiki b/wiki index 1b8020f..172d7d2 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 1b8020f4d1343c582fb3b202048db2b61be29381 +Subproject commit 172d7d268f9bb3bd3c90e3f52c7d118ab2921977 -- cgit 1.4.1