Fix bandwidth reporting when doing a restarted download with "-r".

The offset is already accounted for in xs->lastrcvd and doesn't
have to be subtracted again.

Reported by:	Florian Smeets <flo@smeets.im>
Submitted by:	Mateusz Guzik <mjguzik@gmail.com>
Tested by:	Florian Smeets <flo@smeets.im>
MFC after:	1 week
This commit is contained in:
Andre Oppermann 2012-12-09 22:54:03 +00:00
parent 39d4f2c6f0
commit 162361c198
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244058

View File

@ -183,7 +183,7 @@ stat_bps(struct xferstat *xs)
if (delta == 0.0) {
snprintf(str, sizeof str, "?? Bps");
} else {
bps = (xs->rcvd - xs->lastrcvd - xs->offset) / delta;
bps = (xs->rcvd - xs->lastrcvd) / delta;
snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps));
}
return (str);