Changeset 7265
- Timestamp:
- Dec 4, 2008, 3:31:14 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/bandwidth.c
r7173 r7265 30 30 HISTORY_MSEC = 2000, 31 31 INTERVAL_MSEC = HISTORY_MSEC, 32 GRANULARITY_MSEC = 40,32 GRANULARITY_MSEC = 50, 33 33 HISTORY_SIZE = ( INTERVAL_MSEC / GRANULARITY_MSEC ), 34 34 MAGIC_NUMBER = 43143 … … 255 255 if( b->band[dir].isLimited ) 256 256 { 257 const double desiredSpeed = b->band[dir].desiredSpeed; 258 #if 0 257 259 const double currentSpeed = getSpeed( &b->band[dir].piece, HISTORY_MSEC - period_msec ); 258 const double desiredSpeed = b->band[dir].desiredSpeed;259 260 const double pulseCount = ( HISTORY_MSEC - period_msec ) / (double)period_msec; 260 261 const double nextPulseSpeed = desiredSpeed * ( pulseCount + 1 ) - ( currentSpeed * pulseCount ); 262 #else 263 const double nextPulseSpeed = desiredSpeed; 264 #endif 261 265 b->band[dir].bytesLeft = MAX( 0.0, nextPulseSpeed * 1024.0 * period_msec / 1000.0 ); 262 266
Note: See TracChangeset
for help on using the changeset viewer.