Read only what we need
This commit is contained in:
parent
3f19f64efd
commit
c39ff89fab
1 changed files with 1 additions and 1 deletions
|
@ -235,7 +235,7 @@ class Connection(object):
|
||||||
while 1:
|
while 1:
|
||||||
if read_bytes <= 0:
|
if read_bytes <= 0:
|
||||||
break
|
break
|
||||||
buff = self.sock.recv(64 * 1024)
|
buff = self.sock.recv(min(64 * 1024, read_bytes))
|
||||||
if not buff:
|
if not buff:
|
||||||
break
|
break
|
||||||
buff_len = len(buff)
|
buff_len = len(buff)
|
||||||
|
|
Loading…
Reference in a new issue