From 710046389926c018ee1a5452600f2aaba2113ea3 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 29 Apr 2007 15:28:56 +0000 Subject: [PATCH] ensure the download/upload rates that are sent to the tracker are reset when sending "started" --- libtransmission/tracker.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libtransmission/tracker.c b/libtransmission/tracker.c index 69565f9e0..2244b0114 100644 --- a/libtransmission/tracker.c +++ b/libtransmission/tracker.c @@ -515,18 +515,17 @@ static tr_http_t * getQuery( tr_tracker_t * tc ) char * event, * trackerid, * idparam; uint64_t left; - uint64_t down; - uint64_t up; char start; int numwant = 50; - down = tor->downloadedCur; - up = tor->uploadedCur; if( tc->started ) { event = "&event=started"; - down = 0; - up = 0; + + tor->downloadedPrev += tor->downloadedCur; + tor->downloadedCur = 0; + tor->uploadedPrev += tor->uploadedCur; + tor->uploadedCur = 0; if( shouldChangePort( tc ) ) { @@ -575,8 +574,8 @@ static tr_http_t * getQuery( tr_tracker_t * tc ) "%s%s" "%s", tcInf->announce, start, tor->escapedHashString, - tc->id, tc->publicPort, up, down, left, numwant, - tor->key, idparam, trackerid, event ); + tc->id, tc->publicPort, tor->uploadedCur, tor->downloadedCur, + left, numwant, tor->key, idparam, trackerid, event ); } static tr_http_t * getScrapeQuery( tr_tracker_t * tc )