Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Dec 2012 19:27:30 +0100
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Florian Smeets <flo@smeets.im>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann <andre@FreeBSD.org>
Subject:   Re: svn commit: r243147 - head/usr.bin/fetch
Message-ID:  <20121209182730.GA28989@dft-labs.eu>
In-Reply-To: <50C4D31E.4080000@smeets.im>
References:  <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <mjguzik gmail.com>



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