svn commit: r244058 - head/usr.bin/fetch

Andre Oppermann andre at FreeBSD.org
Sun Dec 9 22:54:03 UTC 2012


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 at smeets.im>
  Submitted by:	Mateusz Guzik <mjguzik at gmail.com>
  Tested by:	Florian Smeets <flo at 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);


More information about the svn-src-head mailing list