SFTP: Make get() work correctly when files are being written to for partial transfers

This commit is contained in:
terrafrost 2012-12-16 02:34:49 -06:00
parent 35832fe2a1
commit 885d7e0f24

View File

@ -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;
} }
} }