Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProgressCallback should report the actual downloaded amount of data and not the requested packets. #1543

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions phpseclib/Net/SFTP.php
Expand Up @@ -2248,9 +2248,6 @@ function get($remote_file, $local_file = false, $offset = 0, $length = -1, $prog
}
$packet = null;
$read+= $packet_size;
if (is_callable($progressCallback)) {
call_user_func($progressCallback, $read);
}
$i++;
}

Expand Down Expand Up @@ -2280,6 +2277,9 @@ function get($remote_file, $local_file = false, $offset = 0, $length = -1, $prog
} else {
fputs($fp, $temp);
}
if (is_callable($progressCallback)) {
call_user_func($progressCallback, $offset);
}
$temp = null;
break;
case NET_SFTP_STATUS:
Expand Down