Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Dec 2012 22:54:03 +0000 (UTC)
From:      Andre Oppermann <andre@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244058 - head/usr.bin/fetch
Message-ID:  <201212092254.qB9Ms3ge052561@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andre
Date: Sun Dec  9 22:54:03 2012
New Revision: 244058
URL: http://svnweb.freebsd.org/changeset/base/244058

Log:
  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

Modified:
  head/usr.bin/fetch/fetch.c

Modified: head/usr.bin/fetch/fetch.c
==============================================================================
--- head/usr.bin/fetch/fetch.c	Sun Dec  9 22:53:53 2012	(r244057)
+++ head/usr.bin/fetch/fetch.c	Sun Dec  9 22:54:03 2012	(r244058)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212092254.qB9Ms3ge052561>