diff options
author | Robey Pointer <robey@lag.net> | 2006-08-01 11:27:15 -0700 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2006-08-01 11:27:15 -0700 |
commit | 4bedcfbf39d1d0fc3bf2ded123bca4fba0b37a6c (patch) | |
tree | 204caf9a7e800bc6f9e36d08df1b06cc44becc42 | |
parent | 05de66db6dde903550862dc08a5409ac102fa487 (diff) |
[project @ robey@lag.net-20060801182715-f0977a00fbcce456]
fix logic in checking prefetch buffers: don't stop looking for prefetched data just because all the buffers have arrived
-rw-r--r-- | paramiko/sftp_file.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py index 5050a214..1e5478b2 100644 --- a/paramiko/sftp_file.py +++ b/paramiko/sftp_file.py @@ -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: |