From 3ad344b0620e1054b34dd51912e17cd1606fa694 Mon Sep 17 00:00:00 2001 From: andre Date: Sun, 9 Dec 2012 22:54:03 +0000 Subject: 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 Submitted by: Mateusz Guzik Tested by: Florian Smeets MFC after: 1 week --- usr.bin/fetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.1