Changeset 788


Ignore:
Timestamp:
Aug 16, 2006, 7:21:09 PM (15 years ago)
Author:
joshe
Message:

Try to keep track of the overall speed of the swarm.
Patch by Denis Ahrens.

Location:
trunk/libtransmission
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/internal.h

    r679 r788  
    128128    tr_ratecontrol_t * upload;
    129129    tr_ratecontrol_t * download;
     130    tr_ratecontrol_t * swarmspeed;
    130131    tr_fd_t          * fdlimit;
    131132
  • trunk/libtransmission/peerparse.h

    r261 r788  
    109109    tr_bitfieldAdd( peer->bitfield, piece );
    110110    updateInterest( tor, peer );
     111
     112    tr_rcTransferred( tor->swarmspeed, tor->info.pieceSize );
    111113
    112114    return 0;
  • trunk/libtransmission/transmission.c

    r780 r788  
    283283    tor->upload         = tr_rcInit();
    284284    tor->download       = tr_rcInit();
     285    tor->swarmspeed     = tr_rcInit();
    285286 
    286287    /* We have a new torrent */
     
    350351    tr_rcReset( tor->download );
    351352    tr_rcReset( tor->upload );
     353    tr_rcReset( tor->swarmspeed );
    352354    tor->status = TR_STATUS_STOPPING;
    353355    tor->stopDate = tr_date();
     
    455457    s->progress = tr_cpCompletionAsFloat( tor->completion );
    456458    if( tor->status & TR_STATUS_DOWNLOAD )
     459    {
    457460        s->rateDownload = tr_rcRate( tor->download );
     461    }
    458462    else
     463    {
    459464        /* tr_rcRate() doesn't make the difference between 'piece'
    460465           messages and other messages, which causes a non-zero
     
    462467           force it to zero not to confuse the user. */
    463468        s->rateDownload = 0.0;
     469    }
    464470    s->rateUpload = tr_rcRate( tor->upload );
    465471   
    466472    s->seeders  = tr_trackerSeeders(tor->tracker);
    467         s->leechers = tr_trackerLeechers(tor->tracker);
     473    s->leechers = tr_trackerLeechers(tor->tracker);
     474
     475    s->swarmspeed = tr_rcRate( tor->swarmspeed );
    468476
    469477    if( s->rateDownload < 0.1 )
     
    589597    tr_rcClose( tor->upload );
    590598    tr_rcClose( tor->download );
     599    tr_rcClose( tor->swarmspeed );
    591600
    592601    if( tor->destination )
  • trunk/libtransmission/transmission.h

    r780 r788  
    322322    uint64_t            downloaded;
    323323    uint64_t            uploaded;
     324    float               swarmspeed;
    324325};
    325326
Note: See TracChangeset for help on using the changeset viewer.