mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
remove race condition
This commit is contained in:
parent
6ca87c5cf4
commit
8622604f44
@ -135,6 +135,7 @@ class TeeInput(object):
|
||||
def _tee(self, length):
|
||||
""" fetch partial body"""
|
||||
while True:
|
||||
print len(self._buf)
|
||||
chunk, self.buf = self.parser.filter_body(self.buf)
|
||||
if chunk:
|
||||
self.tmp.write(chunk)
|
||||
|
||||
@ -90,14 +90,7 @@ def close(sock):
|
||||
pass
|
||||
|
||||
def read_partial(sock, length, buf=None):
|
||||
if buf is not None:
|
||||
if len(buf) >= length:
|
||||
return buf
|
||||
else:
|
||||
length = length - len(buf)
|
||||
|
||||
tmp_buf = sock.recv(length)
|
||||
|
||||
tmp_buf = skt.recv(length)
|
||||
if not buf:
|
||||
return tmp_buf
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user