mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-11 16:15:52 +00:00
SFTP: Make get() work correctly when files are being written to for partial transfers
This commit is contained in:
parent
35832fe2a1
commit
885d7e0f24
@ -1556,7 +1556,11 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($length > 0 && $length <= $offset - $size) {
|
if ($length > 0 && $length <= $offset - $size) {
|
||||||
$content = substr($content, 0, $length);
|
if ($local_file === false) {
|
||||||
|
$content = substr($content, 0, $length);
|
||||||
|
} else {
|
||||||
|
ftruncate($fp, $length);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user