Changeset 7039


Ignore:
Timestamp:
Nov 4, 2008, 5:37:51 PM (12 years ago)
Author:
charles
Message:

(libT) #1417: overhead should be counted in the global stats

Location:
trunk/libtransmission
Files:
3 edited

Legend:

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

    r6991 r7039  
    3131#include "peer-io.h"
    3232#include "ratecontrol.h"
     33#include "stats.h"  /* tr_statsAddUploaded(), tr_statsAddDownloaded() */
    3334#include "trevent.h"
    3435#include "utils.h"
     
    182183        b->bytesUsed += n;
    183184        tr_rcTransferred( io->speedometer[TR_UP], n );
     185        tr_statsAddUploaded( io->session, n );
    184186        dbgmsg( io,
    185187                "wrote %zu bytes to peer... upload bytesLeft is now %zu",
     
    214216        b->bytesUsed += n;
    215217        tr_rcTransferred( io->speedometer[TR_DOWN], n );
     218        tr_statsAddDownloaded( io->session, n );
    216219        dbgmsg( io,
    217220                "%zu new input bytes. bytesUsed is %zu, bytesLeft is %zu",
  • trunk/libtransmission/peer-mgr.c

    r6965 r7039  
    3232#include "peer-msgs.h"
    3333#include "ptrarray.h"
    34 #include "stats.h" /* tr_statsAddDownloaded */
    3534#include "torrent.h"
    3635#include "trevent.h"
     
    10091008            tor->activityDate = now;
    10101009            tor->uploadedCur += e->length;
    1011             tr_statsAddUploaded( tor->session, e->length );
    10121010            if( peer )
    10131011            {
     
    10311029            if( peer )
    10321030                tor->downloadedCur += e->length;
    1033             tr_statsAddDownloaded( tor->session, e->length );
    10341031            if( peer ) {
    10351032                struct peer_atom * a = getExistingAtom( t, &peer->in_addr );
  • trunk/libtransmission/stats.h

    r6795 r7039  
    1414#define TR_STATS_H
    1515
    16 void tr_statsInit( tr_handle * handle );
     16void tr_statsInit           ( tr_session  * session );
    1717
    18 void tr_statsClose( tr_handle * handle );
     18void tr_statsClose          ( tr_session  * session );
    1919
    20 void tr_statsAddUploaded( tr_handle * handle,
    21                           uint32_t    bytes );
     20void tr_statsAddUploaded    ( tr_session  * session,
     21                              uint32_t      bytes );
    2222
    23 void tr_statsAddDownloaded( tr_handle * handle,
    24                             uint32_t    bytes );
     23void tr_statsAddDownloaded  ( tr_session  * session,
     24                              uint32_t      bytes );
    2525
    26 void tr_statsFileCreated( tr_handle * handle );
     26void tr_statsFileCreated    ( tr_session  * session );
    2727
    2828#endif
Note: See TracChangeset for help on using the changeset viewer.