Fix --info=progress2 info as a file is transferred.

Applying Anish Shankar's patch to fix speed and stats of files as they
are transferred.  Fixes bug 10450.
This commit is contained in:
Wayne Davison
2014-02-24 09:49:04 -08:00
parent 4dfe7c9f3e
commit cd909fde87
2 changed files with 11 additions and 5 deletions

View File

@@ -177,6 +177,11 @@ void show_progress(OFF_T ofs, OFF_T size)
gettimeofday(&now, NULL);
if (INFO_GTE(PROGRESS, 2)) {
ofs = stats.total_transferred_size - size + ofs;
size = stats.total_size;
}
if (!ph_start.time.tv_sec) {
int i;
@@ -212,9 +217,5 @@ void show_progress(OFF_T ofs, OFF_T size)
return;
#endif
if (INFO_GTE(PROGRESS, 2)) {
rprint_progress(stats.total_transferred_size,
stats.total_size, &now, False);
} else
rprint_progress(ofs, size, &now, False);
rprint_progress(ofs, size, &now, False);
}