Changeset 3825


Ignore:
Timestamp:
Nov 15, 2007, 5:47:23 AM (14 years ago)
Author:
charles
Message:

more of the same

Location:
trunk/libtransmission
Files:
2 edited

Legend:

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

    r3824 r3825  
    14391439{
    14401440    tr_peer * peer;
    1441     float rate;
    1442     int randomKey;
     1441    double rate;
    14431442    int preferred;
    14441443    int doUnchoke;
     
    14481447compareChoke( const void * va, const void * vb )
    14491448{
     1449    int i;
    14501450    const struct ChokeData * a = va;
    14511451    const struct ChokeData * b = vb;
    14521452
     1453    if(( i = (int)( 10 * ( a->rate - b->rate ))))
     1454        return i;
     1455
    14531456    if( a->preferred != b->preferred )
    14541457        return a->preferred ? -1 : 1;
    14551458
    1456     if( a->preferred )
    1457     {
    1458         if( a->rate > b->rate ) return -1;
    1459         if( a->rate < b->rate ) return 1;
    1460         return 0;
    1461     }
    1462     else
    1463     {
    1464         return a->randomKey - b->randomKey;
    1465     }
     1459    return 0;
    14661460}
    14671461
     
    14811475getWeightedThroughput( const tr_peer * peer )
    14821476{
    1483     /* FIXME: tweak this */
     1477    /* FIXME: tweak this? */
    14841478    return ( 1 * peer->rateToPeer )
    14851479         + ( 1 * peer->rateToClient );
     
    15071501        node->peer = peer;
    15081502        node->preferred = peer->peerIsInterested && !clientIsSnubbedBy(peer);
    1509         node->randomKey = tr_rand( INT_MAX );
    15101503        node->rate = getWeightedThroughput( peer );
    15111504    }
  • trunk/libtransmission/peer-msgs.c

    r3818 r3825  
    570570}
    571571
     572static int
     573pulse( void * vmsgs );
     574
    572575int
    573576tr_peerMsgsAddRequest( tr_peermsgs * msgs,
     
    624627    *req = tmp;
    625628    tr_list_append( &msgs->clientWillAskFor, req );
     629    pulse( msgs );
    626630    return TR_ADDREQ_OK;
    627631}
Note: See TracChangeset for help on using the changeset viewer.