$progressCallback should be called after a specific amount of data has been received and not, if its just requested, as the requested packets might be more as the available and received data.

This commit is contained in:
Thomas A. Hirsch 2020-10-21 18:06:52 +01:00 committed by terrafrost
parent 00c9edc058
commit b2ae60f0a9

View File

@ -2309,9 +2309,6 @@ class Net_SFTP extends Net_SSH2
}
$packet = null;
$read+= $packet_size;
if (is_callable($progressCallback)) {
call_user_func($progressCallback, $read);
}
$i++;
}
@ -2341,6 +2338,9 @@ class Net_SFTP extends Net_SSH2
} else {
fputs($fp, $temp);
}
if (is_callable($progressCallback)) {
call_user_func($progressCallback, $offset);
}
$temp = null;
break;
case NET_SFTP_STATUS: