Changeset 3253


Ignore:
Timestamp:
Oct 1, 2007, 2:24:22 PM (14 years ago)
Author:
charles
Message:

follow BT `best practices' more closely w.r.t. choosing which pieces to download

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r3248 r3253  
    483483    uint32_t peerCount;
    484484    uint32_t fastAllowed;
     485    uint32_t random;
    485486};
    486487
     
    503504        return a->fastAllowed < b->fastAllowed ? -1 : 1;
    504505
    505     /* otherwise go with the earlier piece */
    506     return a->piece - b->piece;
     506    /* otherwise go with our random seed */
     507    return tr_compareUint32( a->random, b->random );
    507508}
    508509
     
    556557            setme->peerCount = 0;
    557558            setme->fastAllowed = 0;
     559            setme->random = tr_rand( UINT32_MAX );
    558560            /* FIXME */
    559561//            setme->fastAllowed = tr_bitfieldHas( t->tor->allowedList, i);
Note: See TracChangeset for help on using the changeset viewer.