Changeset 12420
- Timestamp:
- May 9, 2011, 4:16:49 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/bandwidth.c
r12415 r12420 323 323 static unsigned int 324 324 bandwidthClamp( const tr_bandwidth * b, 325 const uint64_tnow,325 uint64_t now, 326 326 tr_direction dir, 327 327 unsigned int byteCount ) … … 340 340 if( byteCount > 0 ) 341 341 { 342 double current = tr_bandwidthGetRawSpeed_Bps( b, now, TR_DOWN ); 343 double desired = tr_bandwidthGetDesiredSpeed_Bps( b, TR_DOWN ); 344 double r = desired >= 1 ? current / desired : 0; 342 double current; 343 double desired; 344 double r; 345 346 if( now == 0 ) 347 now = tr_time_msec( ); 348 349 current = tr_bandwidthGetRawSpeed_Bps( b, now, TR_DOWN ); 350 desired = tr_bandwidthGetDesiredSpeed_Bps( b, TR_DOWN ); 351 r = desired >= 1 ? current / desired : 0; 345 352 346 353 if( r > 1.0 ) byteCount = 0; … … 361 368 unsigned int byteCount ) 362 369 { 363 const uint64_t now_msec = tr_time_msec( ); 364 return bandwidthClamp( b, now_msec, dir, byteCount ); 370 return bandwidthClamp( b, 0, dir, byteCount ); 365 371 } 366 372
Note: See TracChangeset
for help on using the changeset viewer.