From c39ff89fab55598935d8ee2a5bdfb919112cc11e Mon Sep 17 00:00:00 2001 From: shortcutme Date: Mon, 12 Feb 2018 14:28:45 +0100 Subject: [PATCH] Read only what we need --- src/Connection/Connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Connection/Connection.py b/src/Connection/Connection.py index 96a9a018..f0c825e6 100644 --- a/src/Connection/Connection.py +++ b/src/Connection/Connection.py @@ -235,7 +235,7 @@ class Connection(object): while 1: if read_bytes <= 0: break - buff = self.sock.recv(64 * 1024) + buff = self.sock.recv(min(64 * 1024, read_bytes)) if not buff: break buff_len = len(buff)