ensure the download/upload rates that are sent to the tracker are reset when sending "started"

This commit is contained in:
Mitchell Livingston 2007-04-29 15:28:56 +00:00
parent a8a2e03d13
commit 7100463899
1 changed files with 7 additions and 8 deletions

View File

@ -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 )