Changeset 7560
- Timestamp:
- Dec 31, 2008, 9:15:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/bandwidth.c
r7524 r7560 298 298 tr_ptrArray tmp = TR_PTR_ARRAY_INIT; 299 299 struct tr_peerIo ** peers; 300 const uint64_t now = tr_date( );301 const uint64_t cutoff = now + 100; /* 1/10th of a second */302 300 303 301 … … 315 313 /* First phase of IO. Tries to distribute bandwidth fairly to keep faster 316 314 * peers from starving the others. Loop through the peers, giving each a 317 * small chunk of bandwidth. Keep looping until we r each the cutoff or318 * run out of bandwidthand/or peers that can use it */315 * small chunk of bandwidth. Keep looping until we run out of bandwidth 316 * and/or peers that can use it */ 319 317 n = peerCount; 320 318 i = n ? tr_cryptoWeakRandInt( n ) : 0; /* pick a random starting point */ 321 for( ; n> 0 && tr_date()<=cutoff; )322 { 323 const int increment = n==1 ? 4096 :1024;319 for( ; n>1 ; ) 320 { 321 const int increment = 1024; 324 322 const int byteCount = tr_peerIoFlush( peers[i], dir, increment); 325 323
Note: See TracChangeset
for help on using the changeset viewer.