From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 18:27:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5C539D6; Sun, 9 Dec 2012 18:27:42 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx1.freebsd.org (Postfix) with ESMTP id E264F8FC12; Sun, 9 Dec 2012 18:27:41 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id 12so1308902wgh.31 for ; Sun, 09 Dec 2012 10:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=/VbGk2qhT8BouDMTJNHk9WZN4QQhNjKcqvFzJ29T5zE=; b=QX9bEvdXUCNHXKCS09Y2aYnE23g9H22f7pfQWDhtjT6AwGCgGhxo2B+tWYhMxccOTd r0s6hxI2wpabBzIy6jZh5hYebW8BO1+T/Jkxf/Merm24cD6MGlnuK3Epbrh0GDUMZ4Wf lMh89fP9kBxFp8E3QNKUUvQt3emnfmIPGYFVn0oBg8prqnerxsA4P7mUoeArx+xq4r3Z D8VKYKZK4kavZKBwQI9UHDPrzvHOgYQW/CJs89vGuuN0oXJiWtg0DSJYlPXrtOmMiiNJ EO+y0TNY6YXyjS/EjYVYnHEQBk0I3/YVeR53dU90Z6tPcqKS3sbufkN2uH9qP9QRVBPm IK0A== Received: by 10.180.106.34 with SMTP id gr2mr7209066wib.18.1355077660433; Sun, 09 Dec 2012 10:27:40 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id t17sm8038708wiv.6.2012.12.09.10.27.38 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Dec 2012 10:27:39 -0800 (PST) Date: Sun, 9 Dec 2012 19:27:30 +0100 From: Mateusz Guzik To: Florian Smeets Subject: Re: svn commit: r243147 - head/usr.bin/fetch Message-ID: <20121209182730.GA28989@dft-labs.eu> References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <50C4D31E.4080000@smeets.im> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 18:27:43 -0000 On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: > On 16.11.12 13:05, Andre Oppermann wrote: > > Author: andre > > Date: Fri Nov 16 12:05:10 2012 > > New Revision: 243147 > > URL: http://svnweb.freebsd.org/changeset/base/243147 > > > > Log: > > Change fetch(1) to: > > > > o Report the instantaneous bandwidth instead of an average since the > > beginning of the download. > > > > o At the finish of the download report the average bandwidth and also > > the total time it took instead of 00m00s. > > > > Andre, > > it looks like this change breaks the bandwidth calculation when using -r > > 52% of 146 MB -25199509 Bps 03m28s > > Going back to r243146 fixes it. > Try this: diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 025fcdc..e723d40 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name, off_t size, off_t of gettimeofday(&xs->start, NULL); xs->last.tv_sec = xs->last.tv_usec = 0; xs->size = size; - xs->offset = offset; + xs->offset = 0; xs->rcvd = offset; xs->lastrcvd = offset; if (v_tty && v_level > 0) -- Mateusz Guzik