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):
|
def _tee(self, length):
|
||||||
""" fetch partial body"""
|
""" fetch partial body"""
|
||||||
while True:
|
while True:
|
||||||
|
print len(self._buf)
|
||||||
chunk, self.buf = self.parser.filter_body(self.buf)
|
chunk, self.buf = self.parser.filter_body(self.buf)
|
||||||
if chunk:
|
if chunk:
|
||||||
self.tmp.write(chunk)
|
self.tmp.write(chunk)
|
||||||
|
|||||||
@ -90,14 +90,7 @@ def close(sock):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def read_partial(sock, length, buf=None):
|
def read_partial(sock, length, buf=None):
|
||||||
if buf is not None:
|
tmp_buf = skt.recv(length)
|
||||||
if len(buf) >= length:
|
|
||||||
return buf
|
|
||||||
else:
|
|
||||||
length = length - len(buf)
|
|
||||||
|
|
||||||
tmp_buf = sock.recv(length)
|
|
||||||
|
|
||||||
if not buf:
|
if not buf:
|
||||||
return tmp_buf
|
return tmp_buf
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user