Ignore:
Timestamp:
Jul 15, 2007, 5:19:07 PM (15 years ago)
Author:
charles
Message:

split tr_stat_t's peersTotal into peersTotal and peersConnected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r2355 r2356  
    550550    /* peers... */
    551551    memset( s->peersFrom, 0, sizeof( s->peersFrom ) );
    552     s->peersTotal       = 0;
    553     s->peersUploading   = 0;
    554     s->peersDownloading = 0;
     552    s->peersTotal        = tor->peerCount;
     553    s->peersConnected    = 0;
     554    s->peersUploading    = 0;
     555    s->peersDownloading  = 0;
     556
    555557    for( i=0; i<tor->peerCount; ++i )
    556558    {
    557559        const tr_peer_t * peer = tor->peers[i];
    558         ++s->peersTotal;
     560
    559561        if( tr_peerIsConnected( peer ) )
    560562        {
     563            ++s->peersConnected;
    561564            ++s->peersFrom[tr_peerIsFrom(peer)];
    562565
    563             /*if( tr_peerIsInterested( peer ) && !tr_peerIsChokedByUs( peer ) )*/
    564566            if( tr_peerDownloadRate( peer ) > 0.01 )
    565567                ++s->peersUploading;
    566568
    567             /*if( tr_peerIsInteresting( peer ) && !tr_peerIsChokingUs( peer ) )*/
    568569            if( tr_peerUploadRate( peer ) > 0.01 )
    569570                ++s->peersDownloading;
     
    571572    }
    572573
    573     s->percentDone = tr_cpPercentDone( tor->completion );
    574     s->percentComplete = tr_cpPercentComplete( tor->completion );
    575     s->left     = tr_cpLeftUntilDone( tor->completion );
     574    s->percentDone     = tr_cpPercentDone     ( tor->completion );
     575    s->percentComplete = tr_cpPercentComplete ( tor->completion );
     576    s->left            = tr_cpLeftUntilDone   ( tor->completion );
    576577
    577578
Note: See TracChangeset for help on using the changeset viewer.