SFTP: change upload packet size from 4KB to 32KB

This commit is contained in:
terrafrost 2020-07-07 23:47:17 -05:00
parent 6537e74746
commit d8e39b0864

View File

@ -2085,8 +2085,8 @@ class Net_SFTP extends Net_SSH2
$sent = 0; $sent = 0;
$size = $size < 0 ? ($size & 0x7FFFFFFF) + 0x80000000 : $size; $size = $size < 0 ? ($size & 0x7FFFFFFF) + 0x80000000 : $size;
$sftp_packet_size = 4096; // PuTTY uses 4096 $sftp_packet_size = $this->max_sftp_packet;
// make the SFTP packet be exactly 4096 bytes by including the bytes in the NET_SFTP_WRITE packets "header" // make the SFTP packet be exactly the SFTP packet size by including the bytes in the NET_SFTP_WRITE packets "header"
$sftp_packet_size-= strlen($handle) + 25; $sftp_packet_size-= strlen($handle) + 25;
$i = $j = 0; $i = $j = 0;
while ($dataCallback || ($size === 0 || $sent < $size)) { while ($dataCallback || ($size === 0 || $sent < $size)) {