mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
(trunk libT) bandwidth.c: minor phaseOne() improvements suggested by livings
This commit is contained in:
parent
8a90847072
commit
4f1db26672
1 changed files with 2 additions and 2 deletions
|
@ -197,7 +197,7 @@ allocateBandwidth( tr_bandwidth * b,
|
||||||
static void
|
static void
|
||||||
phaseOne( tr_ptrArray * peerArray, tr_direction dir )
|
phaseOne( tr_ptrArray * peerArray, tr_direction dir )
|
||||||
{
|
{
|
||||||
int i, n;
|
int n;
|
||||||
int peerCount = tr_ptrArraySize( peerArray );
|
int peerCount = tr_ptrArraySize( peerArray );
|
||||||
struct tr_peerIo ** peers = (struct tr_peerIo**) tr_ptrArrayBase( peerArray );
|
struct tr_peerIo ** peers = (struct tr_peerIo**) tr_ptrArrayBase( peerArray );
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ phaseOne( tr_ptrArray * peerArray, tr_direction dir )
|
||||||
dbgmsg( "%d peers to go round-robin for %s", n, (dir==TR_UP?"upload":"download") );
|
dbgmsg( "%d peers to go round-robin for %s", n, (dir==TR_UP?"upload":"download") );
|
||||||
while( n > 0 )
|
while( n > 0 )
|
||||||
{
|
{
|
||||||
i = n ? tr_cryptoWeakRandInt( n ) : 0; /* pick a peer at random */
|
const int i = tr_cryptoWeakRandInt( n ); /* pick a peer at random */
|
||||||
|
|
||||||
/* value of 3000 bytes chosen so that when using uTP we'll send a full-size
|
/* value of 3000 bytes chosen so that when using uTP we'll send a full-size
|
||||||
* frame right away and leave enough buffered data for the next frame to go
|
* frame right away and leave enough buffered data for the next frame to go
|
||||||
|
|
Loading…
Reference in a new issue