Changeset 12112


Ignore:
Timestamp:
Mar 7, 2011, 2:59:47 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) #4084 "after reaching seed state, no new peers are acquired" -- possible fix.

This revises r12110 based on feedback from sadface about the use of tr_atom.uploadOnly.

File:
1 edited

Legend:

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

    r12111 r12112  
    106106**/
    107107
    108 enum
    109 {
    110     UPLOAD_ONLY_UKNOWN,
    111     UPLOAD_ONLY_YES,
    112     UPLOAD_ONLY_NO
    113 };
    114 
    115108/**
    116109 * Peer information that should be kept even before we've connected and
     
    128121    uint8_t     flags;              /* these match the added_f flags */
    129122    uint8_t     flags2;             /* flags that aren't defined in added_f */
    130     uint8_t     uploadOnly;         /* UPLOAD_ONLY_ */
    131123    int8_t      seedProbability;    /* how likely is this to be a seed... [0..100] or -1 for unknown */
    132124    int8_t      blocklisted;        /* -1 for unknown, TRUE for blocklisted, FALSE for not blocklisted */
     
    26352627        return TRUE;
    26362628
    2637     if( peer->atom && ( peer->atom->uploadOnly == UPLOAD_ONLY_YES ) )
     2629    if( peer->atom && atomIsSeed( peer->atom ) )
    26382630        return TRUE;
    26392631
     
    30183010        struct peer_atom * atom = peer->atom;
    30193011
    3020         if( peer->progress >= 1.0 ) /* choke all seeds */
    3021         {
    3022             tr_peerMsgsSetChoke( peer->msgs, TRUE );
    3023         }
    3024         else if( atom->uploadOnly == UPLOAD_ONLY_YES ) /* choke partial seeds */
     3012        if( peerIsSeed( peer ) ) /* choke seeds and partial seeds */
    30253013        {
    30263014            tr_peerMsgsSetChoke( peer->msgs, TRUE );
     
    36563644{
    36573645    /* not if we're both seeds */
    3658     if( tr_torrentIsSeed( tor ) )
    3659         if( atomIsSeed( atom ) || ( atom->uploadOnly == UPLOAD_ONLY_YES ) )
    3660             return FALSE;
     3646    if( tr_torrentIsSeed( tor ) && atomIsSeed( atom ) )
     3647        return FALSE;
    36613648
    36623649    /* not if we've already got a connection to them... */
Note: See TracChangeset for help on using the changeset viewer.