mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 02:07:09 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
eeb65b2341
@ -1890,7 +1890,7 @@ class SFTP extends SSH2
|
||||
// make the SFTP packet be exactly 4096 bytes by including the bytes in the NET_SFTP_WRITE packets "header"
|
||||
$sftp_packet_size-= strlen($handle) + 25;
|
||||
$i = 0;
|
||||
while ($dataCallback || $sent < $size) {
|
||||
while ($dataCallback || ($size === 0 || $sent < $size)) {
|
||||
if ($dataCallback) {
|
||||
$temp = call_user_func($dataCallback, $sftp_packet_size);
|
||||
if (is_null($temp)) {
|
||||
@ -1898,7 +1898,11 @@ class SFTP extends SSH2
|
||||
}
|
||||
} else {
|
||||
$temp = isset($fp) ? fread($fp, $sftp_packet_size) : substr($data, $sent, $sftp_packet_size);
|
||||
if ($temp === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$subtemp = $offset + $sent;
|
||||
$packet = pack('Na*N3a*', strlen($handle), $handle, $subtemp / 4294967296, $subtemp, strlen($temp), $temp);
|
||||
if (!$this->_send_sftp_packet(NET_SFTP_WRITE, $packet)) {
|
||||
|
Loading…
Reference in New Issue
Block a user