From 8ad76c9236f712d639735fd5dc870396ddb338e0 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Fri, 20 Jan 2012 06:36:16 +0000 Subject: [PATCH] - get() no longer needs to know the size of a file to download it (thanks xyzzy!) git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@194 21d32557-59b3-4da0-833f-c5933fad653e --- phpseclib/Net/SFTP.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 84b32f0e..4049f8e9 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -1430,11 +1430,6 @@ class Net_SFTP extends Net_SSH2 { return false; } - $size = $this->_size($remote_file); - if ($size === false) { - return false; - } - $packet = pack('Na*N2', strlen($remote_file), $remote_file, NET_SFTP_OPEN_READ, 0); if (!$this->_send_sftp_packet(NET_SFTP_OPEN, $packet)) { return false; @@ -1464,7 +1459,7 @@ class Net_SFTP extends Net_SSH2 { } $read = 0; - while ($read < $size) { + while (true) { $packet = pack('Na*N3', strlen($handle), $handle, 0, $read, 1 << 20); if (!$this->_send_sftp_packet(NET_SFTP_READ, $packet)) { if ($local_file !== false) {