From 17b8624ca7cb8dd82746feeedc75888ec51e98cc Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 4 Nov 2008 21:33:24 +0000 Subject: [PATCH] (libT) #1417: revert r7039 --- libtransmission/peer-io.c | 3 --- libtransmission/peer-mgr.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index 3e1f46088..109a4ed3d 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -30,7 +30,6 @@ #include "net.h" #include "peer-io.h" #include "ratecontrol.h" -#include "stats.h" /* tr_statsAddUploaded(), tr_statsAddDownloaded() */ #include "trevent.h" #include "utils.h" @@ -182,7 +181,6 @@ didWriteWrapper( struct bufferevent * e, 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, @@ -215,7 +213,6 @@ canReadWrapper( struct bufferevent * e, 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, diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 40a3828a3..c59e17d10 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -31,6 +31,7 @@ #include "peer-mgr-private.h" #include "peer-msgs.h" #include "ptrarray.h" +#include "stats.h" /* tr_statsAddUploaded, tr_statsAddDownloaded */ #include "torrent.h" #include "trevent.h" #include "utils.h" @@ -1007,6 +1008,7 @@ peerCallbackFunc( void * vpeer, 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 ); @@ -1028,6 +1030,7 @@ peerCallbackFunc( void * vpeer, * 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;