mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-28 12:10:59 +00:00
SFTP: Add optimization for put() with NET_SFTP_LOCAL_FILE
Use substr() instead of _string_shift().
This commit is contained in:
parent
a6289036a0
commit
5e0d58f082
@ -1516,7 +1516,7 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
$sftp_packet_size = 4096; // PuTTY uses 4096
|
$sftp_packet_size = 4096; // PuTTY uses 4096
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($sent < $size) {
|
while ($sent < $size) {
|
||||||
$temp = $mode & NET_SFTP_LOCAL_FILE ? fread($fp, $sftp_packet_size) : $this->_string_shift($data, $sftp_packet_size);
|
$temp = $mode & NET_SFTP_LOCAL_FILE ? fread($fp, $sftp_packet_size) : substr($data, $sent, $sftp_packet_size);
|
||||||
$subtemp = $offset + $sent;
|
$subtemp = $offset + $sent;
|
||||||
$packet = pack('Na*N3a*', strlen($handle), $handle, $subtemp / 0x100000000, $subtemp, strlen($temp), $temp);
|
$packet = pack('Na*N3a*', strlen($handle), $handle, $subtemp / 0x100000000, $subtemp, strlen($temp), $temp);
|
||||||
if (!$this->_send_sftp_packet(NET_SFTP_WRITE, $packet)) {
|
if (!$this->_send_sftp_packet(NET_SFTP_WRITE, $packet)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user