Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Dec 2012 19:42:02 +0100
From:      Florian Smeets <flo@smeets.im>
To:        Mateusz Guzik <mjguzik@gmail.com>
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:  <50C4DB7A.9050302@smeets.im>
In-Reply-To: <20121209182730.GA28989@dft-labs.eu>
References:  <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> <20121209182730.GA28989@dft-labs.eu>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
------enig2OQMAESFMISHHKKNJLKDJ
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 09.12.12 19:27, Mateusz Guzik wrote:
> 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:
>>>  =20
>>>   o Report the instantaneous bandwidth instead of an average since th=
e
>>>     beginning of the download.
>>>  =20
>>>   o At the finish of the download report the average bandwidth and al=
so
>>>     the total time it took instead of 00m00s.
>>>  =20
>>
>> 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.
>>
>=20
> 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, o=
ff_t size, off_t of
>         gettimeofday(&xs->start, NULL);
>         xs->last.tv_sec =3D xs->last.tv_usec =3D 0;
>         xs->size =3D size;
> -       xs->offset =3D offset;
> +       xs->offset =3D 0;
>         xs->rcvd =3D offset;
>         xs->lastrcvd =3D offset;
>         if (v_tty && v_level > 0)
>=20

That way the bandwidth calculation looks OK but now it counts the time
since starting to resume the download and not the time left :)

63% of  146 MB 7069 kBps 00m07s

Florian


------enig2OQMAESFMISHHKKNJLKDJ
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAlDE23oACgkQapo8P8lCvwnVaQCdHhGGQsFzDMcqve+kVqsGsFEJ
4OkAoJUIEMjAovUsgNbos0ASjrAXmbO/
=2JJ9
-----END PGP SIGNATURE-----

------enig2OQMAESFMISHHKKNJLKDJ--



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