From 4bedcfbf39d1d0fc3bf2ded123bca4fba0b37a6c Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Tue, 1 Aug 2006 11:27:15 -0700 Subject: [PATCH] [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 --- paramiko/sftp_file.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py index 5050a21..1e5478b 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: