remove race condition

This commit is contained in:
benoitc 2010-03-04 19:23:37 +01:00
parent 6ca87c5cf4
commit 8622604f44
2 changed files with 2 additions and 8 deletions

View File

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

View File

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