make sure we write at the end. fix 002-test-request.test_011 . spotted

by jbergstroem on irc. thanks!
This commit is contained in:
benoitc 2010-02-27 18:01:05 +01:00
parent 49d340ce2b
commit 87d3c4b3e7

View File

@ -44,6 +44,7 @@ class TeeInput(object):
if self._is_socket:
pos = self.tmp.tell()
while True:
self.tmp.seek(self._tmp_size())
if not self._tee(CHUNK_SIZE):
break
self.tmp.seek(pos)
@ -54,6 +55,7 @@ class TeeInput(object):
if self._is_socket:
pos = self.tmp.tell()
while True:
self.tmp.seek(self._tmp_size())
if not self._tee(CHUNK_SIZE):
break
self.tmp.seek(pos)
@ -137,6 +139,9 @@ class TeeInput(object):
if chunk:
self.tmp.write(chunk)
self.tmp.seek(0, os.SEEK_END)
self.tmp.flush()
if hasattr(self.tmp, 'fileno'):
os.fsync(self.tmp.fileno())
return chunk
if self.parser.body_eof():