Ignore:
Timestamp:
Jul 15, 2007, 5:18:18 AM (15 years ago)
Author:
charles
Message:

make tr_stat_t and tr_peer_stat_t more accurately reflect ul/dl rates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r2350 r2353  
    553553    s->peersUploading   = 0;
    554554    s->peersDownloading = 0;
    555     for( i=0; i<tor->peerCount; ++i ) {
     555    for( i=0; i<tor->peerCount; ++i )
     556    {
    556557        const tr_peer_t * peer = tor->peers[i];
    557558        ++s->peersTotal;
    558         if( tr_peerIsConnected( peer ) ) {
     559        if( tr_peerIsConnected( peer ) )
     560        {
    559561            ++s->peersFrom[tr_peerIsFrom(peer)];
    560             if( tr_peerIsInterested( peer ) && !tr_peerIsChokedByUs( peer ) )
     562
     563            /*if( tr_peerIsInterested( peer ) && !tr_peerIsChokedByUs( peer ) )*/
     564            if( tr_peerUploadRate( peer ) > 0.01 )
    561565                ++s->peersUploading;
    562             if( tr_peerIsInteresting( peer ) && !tr_peerIsChokingUs( peer ) )
     566
     567            /*if( tr_peerIsInteresting( peer ) && !tr_peerIsChokingUs( peer ) )*/
     568            if( tr_peerDownloadRate( peer ) > 0.01 )
    563569                ++s->peersDownloading;
    564570        }
     
    652658            peers[i].progress         =  tr_peerProgress( peer );
    653659            peers[i].port             =  tr_peerPort( peer );
    654             peers[i].isDownloading    = !tr_peerIsChokingUs( peer );
     660
    655661            peers[i].uploadToRate     =  tr_peerUploadRate( peer );
    656             peers[i].isUploading      = !tr_peerIsChokedByUs( peer );
     662            peers[i].isUploading      =  peers[i].uploadToRate > 0.01;
     663
    657664            peers[i].downloadFromRate =  tr_peerDownloadRate( peer );
     665            peers[i].isDownloading    =  peers[i].downloadFromRate > 0.01;
    658666        }
    659667    }
Note: See TracChangeset for help on using the changeset viewer.