summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2012-12-09 22:54:03 +0000
committerandre <andre@FreeBSD.org>2012-12-09 22:54:03 +0000
commit3ad344b0620e1054b34dd51912e17cd1606fa694 (patch)
treefefb4fe9332bb874aaf8bdf4aba396956f65b53b
parent972c593040062318ce2414510340540d5398a1de (diff)
downloadFreeBSD-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
-rw-r--r--usr.bin/fetch/fetch.c2
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);
OpenPOWER on IntegriCloud