Ignore:
Timestamp:
Apr 20, 2010, 9:54:03 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #3159 "better decision-making when choosing which peers to initiate new connections with" -- experimental commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r10496 r10500  
    355355                   void * user_data )
    356356{
    357     tr_torrent *       tor = user_data;
     357    tr_torrent * tor = user_data;
    358358    tr_tracker_event * event = vevent;
    359359
     
    362362        case TR_TRACKER_PEERS:
    363363        {
    364             size_t   i, n;
     364            size_t i, n;
     365            const int seedProbability = event->seedProbability;
     366            const tr_bool allAreSeeds = seedProbability == 100;
    365367            tr_pex * pex = tr_peerMgrArrayToPex( event->compact,
    366368                                                 event->compactLen, &n );
    367              if( event->allAreSeeds )
     369             if( allAreSeeds )
    368370                tr_tordbg( tor, "Got %d seeds from tracker", (int)n );
    369371            else
     
    371373
    372374            for( i = 0; i < n; ++i )
    373             {
    374                 if( event->allAreSeeds )
    375                     pex[i].flags |= ADDED_F_SEED_FLAG;
    376                 tr_peerMgrAddPex( tor, TR_PEER_FROM_TRACKER, pex + i );
    377             }
     375                tr_peerMgrAddPex( tor, TR_PEER_FROM_TRACKER, pex+i, seedProbability );
     376
     377            if( allAreSeeds && tr_torrentIsPrivate( tor ) )
     378                tr_peerMgrMarkAllAsSeeds( tor );
    378379
    379380            tr_free( pex );
Note: See TracChangeset for help on using the changeset viewer.