diff options
author | andre <andre@FreeBSD.org> | 2012-12-09 22:54:03 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2012-12-09 22:54:03 +0000 |
commit | 3ad344b0620e1054b34dd51912e17cd1606fa694 (patch) | |
tree | fefb4fe9332bb874aaf8bdf4aba396956f65b53b /usr.bin/fetch | |
parent | 972c593040062318ce2414510340540d5398a1de (diff) | |
download | FreeBSD-src-3ad344b0620e1054b34dd51912e17cd1606fa694.zip FreeBSD-src-3ad344b0620e1054b34dd51912e17cd1606fa694.tar.gz |
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
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r-- | usr.bin/fetch/fetch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 025fcdc..d3e9b21 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -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); |