Changeset 12110


Ignore:
Timestamp:
Mar 7, 2011, 4:48:46 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) simpler implementation of the idea behind the code removed in r12108 and r12109.

File:
1 edited

Legend:

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

    r12109 r12110  
    26272627}
    26282628
     2629static tr_bool
     2630peerIsSeed( const tr_peer * peer )
     2631{
     2632    if( peer->progress >= 1.0 )
     2633        return TRUE;
     2634
     2635    if( peer->atom && ( peer->atom->uploadOnly == UPLOAD_ONLY_YES ) )
     2636        return TRUE;
     2637
     2638    return FALSE;
     2639}
    26292640
    26302641struct tr_peer_stat *
     
    26672678        stat->isDownloadingFrom   = clientIsDownloadingFrom( tor, peer );
    26682679        stat->isUploadingTo       = clientIsUploadingTo( peer );
    2669         stat->isSeed              = ( atom->uploadOnly == UPLOAD_ONLY_YES ) || ( peer->progress >= 1.0 );
     2680        stat->isSeed              = peerIsSeed( peer );
    26702681
    26712682        stat->blocksToPeer        = tr_historyGet( &peer->blocksSentToPeer,    now, CANCEL_HISTORY_SEC );
     
    31363147
    31373148    /* disconnect if we're both seeds and enough time has passed for PEX */
    3138     if( tr_torrentIsSeed( tor ) && ( peer->progress >= 1.0f ) )
     3149    if( tr_torrentIsSeed( tor ) && peerIsSeed( peer ) )
    31393150        return !tr_torrentAllowsPex(tor) || (now-atom->time>=30);
    31403151
Note: See TracChangeset for help on using the changeset viewer.