Changeset 12072


Ignore:
Timestamp:
Mar 3, 2011, 7:20:18 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) minor revision to r12065: clamp the bandwidth before applying the ratio calculation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bandwidth.c

    r12063 r12072  
    324324            double r = desired > 0.001 ? current / desired : 0;
    325325            size_t i;
     326
     327            byteCount = MIN( byteCount, b->band[dir].bytesLeft );
     328
    326329                 if( r > 1.0 ) i = 0;
    327330            else if( r > 0.9 ) i = byteCount * 0.9;
    328331            else if( r > 0.8 ) i = byteCount * 0.8;
    329332            else               i = byteCount;
    330 
    331             byteCount = MIN( byteCount, b->band[dir].bytesLeft );
    332333
    333334            //fprintf( stderr, "--> %.4f  (%f... %f) [%zu --> %zu]\n", r, current, desired, byteCount, i );
Note: See TracChangeset for help on using the changeset viewer.