fix logic in checking prefetch buffers: don't stop looking for prefetched data just because all the buffers have arrived
This commit is contained in:
Robey Pointer 2006-08-01 11:27:15 -07:00
parent 05de66db6d
commit 4bedcfbf39
1 changed files with 3 additions and 1 deletions

View File

@ -122,10 +122,12 @@ class SFTPFile (BufferedFile):
in the buffer, return None. otherwise, behaves like a normal read.
"""
# while not closed, and haven't fetched past the current position, and haven't reached EOF...
while not self._prefetch_done and not self._closed:
while True:
offset = self._data_in_prefetch_buffers(self._realpos)
if offset is not None:
break
if self._prefetch_done or self._closed:
break
self.sftp._read_response()
self._check_exception()
if offset is None: