Read only what we need

This commit is contained in:
shortcutme 2018-02-12 14:28:45 +01:00
parent 3f19f64efd
commit c39ff89fab
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -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)