mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-09-27 22:59:02 +00:00
- 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
This commit is contained in:
parent
883b13f540
commit
8ad76c9236
@ -1430,11 +1430,6 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
return false;
|
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);
|
$packet = pack('Na*N2', strlen($remote_file), $remote_file, NET_SFTP_OPEN_READ, 0);
|
||||||
if (!$this->_send_sftp_packet(NET_SFTP_OPEN, $packet)) {
|
if (!$this->_send_sftp_packet(NET_SFTP_OPEN, $packet)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1464,7 +1459,7 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$read = 0;
|
$read = 0;
|
||||||
while ($read < $size) {
|
while (true) {
|
||||||
$packet = pack('Na*N3', strlen($handle), $handle, 0, $read, 1 << 20);
|
$packet = pack('Na*N3', strlen($handle), $handle, 0, $read, 1 << 20);
|
||||||
if (!$this->_send_sftp_packet(NET_SFTP_READ, $packet)) {
|
if (!$this->_send_sftp_packet(NET_SFTP_READ, $packet)) {
|
||||||
if ($local_file !== false) {
|
if ($local_file !== false) {
|
||||||
|
Loading…
Reference in New Issue
Block a user