diff --git a/net.py b/net.py index c4d0bb9..3f93f23 100644 --- a/net.py +++ b/net.py @@ -22,8 +22,8 @@ def recv(s: socket.socket): pickled = b"" toread = length - while toread: + while toread > 0: read = s.recv(toread) pickled += read toread -= len(pickled) - return pickle.loads(pickled) + return pickle.loads(pickled[:length])