Changeset 2356


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

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/transmissioncli.c

    r2325 r2356  
    261261                "Progress: %.2f %%, %d peer%s, dl from %d (%.2f KB/s), "
    262262                "ul to %d (%.2f KB/s) [%s]", 100.0 * s->percentDone,
    263                 s->peersTotal, ( s->peersTotal == 1 ) ? "" : "s",
     263                s->peersConnected, ( s->peersConnected == 1 ) ? "" : "s",
    264264                s->peersUploading, s->rateDownload,
    265265                s->peersDownloading, s->rateUpload,
  • trunk/gtk/tr_core.c

    r2245 r2356  
    214214        /* error,   errorString,   percentComplete, percentDone,  rateDownload, rateUpload, */
    215215        G_TYPE_INT, G_TYPE_STRING, G_TYPE_FLOAT,    G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_FLOAT,
    216         /* eta,     peersTotal, peersUploading, peersDownloading, seeders, */
    217         G_TYPE_INT, G_TYPE_INT, G_TYPE_INT,     G_TYPE_INT,       G_TYPE_INT,
     216        /* eta,     peersConnected, peersUploading, peersDownloading, seeders, */
     217        G_TYPE_INT, G_TYPE_INT,     G_TYPE_INT,     G_TYPE_INT,       G_TYPE_INT,
    218218        /* leechers, completedFromTracker, downloaded,    uploaded */
    219219        G_TYPE_INT,  G_TYPE_INT,           G_TYPE_UINT64, G_TYPE_UINT64,
     
    611611                            MC_URATE,       st->rateUpload,
    612612                            MC_ETA,         st->eta,
    613                             MC_PEERS,       st->peersTotal,
     613                            MC_PEERS,       st->peersConnected,
    614614                            MC_UPEERS,      st->peersUploading,
    615615                            MC_DPEERS,      st->peersDownloading,
  • trunk/gtk/tr_torrent.c

    r2304 r2356  
    605605    const tr_stat_t * st = tr_torrent_stat( gtor );
    606606
    607     const int tpeers = MAX (st->peersTotal, 0);
     607    const int tpeers = MAX (st->peersConnected, 0);
    608608    const int upeers = MAX (st->peersUploading, 0);
    609609    const int eta = st->eta;
  • 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
  • trunk/libtransmission/transmission.h

    r2346 r2356  
    586586    int                 eta;
    587587    int                 peersTotal;
     588    int                 peersConnected;
    588589    int                 peersFrom[TR_PEER_FROM__MAX];
    589590    int                 peersUploading;
Note: See TracChangeset for help on using the changeset viewer.