#include "net.h"
#include "peer-io.h"
#include "ratecontrol.h"
+#include "stats.h" /* tr_statsAddUploaded(), tr_statsAddDownloaded() */
#include "trevent.h"
#include "utils.h"
b->bytesLeft -= MIN( b->bytesLeft, (size_t)n );
b->bytesUsed += n;
tr_rcTransferred( io->speedometer[TR_UP], n );
+ tr_statsAddUploaded( io->session, n );
dbgmsg( io,
"wrote %zu bytes to peer... upload bytesLeft is now %zu",
n,
b->bytesLeft -= MIN( b->bytesLeft, (size_t)n );
b->bytesUsed += n;
tr_rcTransferred( io->speedometer[TR_DOWN], n );
+ tr_statsAddDownloaded( io->session, n );
dbgmsg( io,
"%zu new input bytes. bytesUsed is %zu, bytesLeft is %zu",
n, b->bytesUsed,
#include "peer-mgr-private.h"
#include "peer-msgs.h"
#include "ptrarray.h"
-#include "stats.h" /* tr_statsAddDownloaded */
#include "torrent.h"
#include "trevent.h"
#include "utils.h"
tr_torrent * tor = t->tor;
tor->activityDate = now;
tor->uploadedCur += e->length;
- tr_statsAddUploaded( tor->session, e->length );
if( peer )
{
struct peer_atom * a = getExistingAtom( t, &peer->in_addr );
* into the jurisdiction of the tracker." */
if( peer )
tor->downloadedCur += e->length;
- tr_statsAddDownloaded( tor->session, e->length );
if( peer ) {
struct peer_atom * a = getExistingAtom( t, &peer->in_addr );
a->piece_data_time = now;
#ifndef TR_STATS_H
#define TR_STATS_H
-void tr_statsInit( tr_handle * handle );
+void tr_statsInit ( tr_session * session );
-void tr_statsClose( tr_handle * handle );
+void tr_statsClose ( tr_session * session );
-void tr_statsAddUploaded( tr_handle * handle,
- uint32_t bytes );
+void tr_statsAddUploaded ( tr_session * session,
+ uint32_t bytes );
-void tr_statsAddDownloaded( tr_handle * handle,
- uint32_t bytes );
+void tr_statsAddDownloaded ( tr_session * session,
+ uint32_t bytes );
-void tr_statsFileCreated( tr_handle * handle );
+void tr_statsFileCreated ( tr_session * session );
#endif