From cb4b05fde65b44de2bc9965010d65bfd2fa00529 Mon Sep 17 00:00:00 2001 From: Anish Shankar Date: Mon, 20 Jan 2014 00:13:36 +0530 Subject: [PATCH] info=progress2 displays wrong transfer rates info=progress2 sets the entire file size as instantaneously transferred an shows a huge speed which slows down as file actually transfers. This results in extremely large speeds and very short ETAs for most of the time --- progress.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/progress.c b/progress.c index 8fade9c..318a77f 100644 --- a/progress.c +++ b/progress.c @@ -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); } -- 1.8.5.3