mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
right length
This commit is contained in:
parent
77ea9ea78a
commit
6ca87c5cf4
@ -90,8 +90,11 @@ def close(sock):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def read_partial(sock, length, buf=None):
|
def read_partial(sock, length, buf=None):
|
||||||
if buf is not None and len(buf) >= length:
|
if buf is not None:
|
||||||
return buf
|
if len(buf) >= length:
|
||||||
|
return buf
|
||||||
|
else:
|
||||||
|
length = length - len(buf)
|
||||||
|
|
||||||
tmp_buf = sock.recv(length)
|
tmp_buf = sock.recv(length)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user