]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2003/12/02 12:15:10
authordtucker <dtucker>
Tue, 9 Dec 2003 08:07:13 +0000 (08:07 +0000)
committerdtucker <dtucker>
Tue, 9 Dec 2003 08:07:13 +0000 (08:07 +0000)
     [progressmeter.c]
     improvments from andreas@:
     * saner speed estimate for transfers that takes less than a second by
       rounding the time to 1 second.
     * when the transfer is finished calculate the actual total speed
       rather than the current speed which is given during the transfer

ChangeLog
progressmeter.c

index e0f2dc8b5ed49ed54326523aa60bb9e2f84a3f97..1b3af8aeff57dc496cc9a7418139bc69bb4aef88 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,13 @@
      [cipher-aes.c]
      fix #ifdef before #define; ok markus@
      (RCS ID sync only, Portable already had this)
+   - markus@cvs.openbsd.org 2003/12/02 12:15:10
+     [progressmeter.c]
+     improvments from andreas@:
+     * saner speed estimate for transfers that takes less than a second by
+       rounding the time to 1 second.
+     * when the transfer is finished calculate the actual total speed
+       rather than the current speed which is given during the transfer
 
 20031208
  - (tim) [configure.ac] Bug 770. Fix --without-rpath.
index 39940bd9a00afd64a51ec40207af85e280760156..7b76c959ecd562a39bd9305cc66d2d102bd3e295 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: progressmeter.c,v 1.17 2003/11/20 11:39:28 markus Exp $");
+RCSID("$OpenBSD: progressmeter.c,v 1.18 2003/12/02 12:15:10 markus Exp $");
 
 #include "progressmeter.h"
 #include "atomicio.h"
@@ -120,14 +120,18 @@ refresh_progress_meter(void)
 
        if (bytes_left > 0)
                elapsed = now - last_update;
-       else
+       else {
                elapsed = now - start;
+               /* Calculate true total speed when done */
+               transferred = end_pos;
+               bytes_per_second = 0;
+       }
 
        /* calculate speed */
        if (elapsed != 0)
                cur_speed = (transferred / elapsed);
        else
-               cur_speed = 0;
+               cur_speed = transferred;
 
 #define AGE_FACTOR 0.9
        if (bytes_per_second != 0) {
This page took 0.155094 seconds and 5 git commands to generate.