Changeset 7167


Ignore:
Timestamp:
Nov 27, 2008, 6:56:58 PM (10 years ago)
Author:
charles
Message:

(libT) tweak the speed allocation a little more.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bandwidth.c

    r7161 r7167  
    255255    if( b->band[dir].isLimited )
    256256    {
    257         const double currentSpeed = tr_bandwidthGetPieceSpeed( b, dir ); /* KiB/s */
    258         const double desiredSpeed = b->band[dir].desiredSpeed;           /* KiB/s */
    259         const double pulseCount = HISTORY_MSEC / (double)period_msec;
     257        const double currentSpeed = getSpeed( &b->band[dir].piece, HISTORY_MSEC - period_msec );
     258        const double desiredSpeed = b->band[dir].desiredSpeed;
     259        const double pulseCount = ( HISTORY_MSEC - period_msec ) / (double)period_msec;
    260260        const double nextPulseSpeed = desiredSpeed * ( pulseCount + 1 ) - ( currentSpeed * pulseCount );
    261261        b->band[dir].bytesLeft = nextPulseSpeed * 1024.0 * period_msec / 1000.0;
Note: See TracChangeset for help on using the changeset viewer.