Changeset 931
- Timestamp:
- 09/27/2006 12:36:04 AM (2 years ago)
- Files:
-
- trunk/libtransmission/fastresume.h (modified) (4 diffs)
- trunk/libtransmission/internal.h (modified) (1 diff)
- trunk/libtransmission/peer.c (modified) (1 diff)
- trunk/libtransmission/peerparse.h (modified) (1 diff)
- trunk/libtransmission/tracker.c (modified) (4 diffs)
- trunk/libtransmission/transmission.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtransmission/fastresume.h
r920 r931 126 126 char * path; 127 127 uint8_t * buf; 128 uint64_t total; 128 129 129 130 buf = malloc( FR_PROGRESS_LEN( tor ) ); … … 162 163 163 164 /* Write download and upload totals */ 164 fastResumeWriteData( FR_ID_DOWNLOADED, &tor->downloaded, 8, 1, file ); 165 fastResumeWriteData( FR_ID_UPLOADED, &tor->uploaded, 8, 1, file ); 165 total = tor->downloadedCur + tor->downloadedPrev; 166 fastResumeWriteData( FR_ID_DOWNLOADED, &total, 8, 1, file ); 167 total = tor->uploadedCur + tor->uploadedPrev; 168 fastResumeWriteData( FR_ID_UPLOADED, &total, 8, 1, file ); 166 169 167 170 fclose( file ); … … 334 337 if( 8 == len) 335 338 { 336 if( 1 != fread( &tor->downloaded , 8, 1, file ) )339 if( 1 != fread( &tor->downloadedPrev, 8, 1, file ) ) 337 340 { 338 341 fclose( file ); … … 347 350 if( 8 == len) 348 351 { 349 if( 1 != fread( &tor->uploaded , 8, 1, file ) )352 if( 1 != fread( &tor->uploadedPrev, 8, 1, file ) ) 350 353 { 351 354 fclose( file ); trunk/libtransmission/internal.h
r920 r931 182 182 183 183 uint64_t date; 184 uint64_t downloaded; 185 uint64_t uploaded; 184 uint64_t downloadedCur; 185 uint64_t downloadedPrev; 186 uint64_t uploadedCur; 187 uint64_t uploadedPrev; 186 188 187 189 tr_stat_t stats[2]; trunk/libtransmission/peer.c
r926 r931 432 432 tr_rcTransferred( tor->globalUpload, ret ); 433 433 434 tor->uploaded += ret;435 peer->outTotal += ret;436 peer->outDate = tr_date();434 tor->uploadedCur += ret; 435 peer->outTotal += ret; 436 peer->outDate = tr_date(); 437 437 438 438 /* In case this block is done, you may have messages trunk/libtransmission/peerparse.h
r788 r931 273 273 } 274 274 275 tor->downloaded += r->length;275 tor->downloadedCur += r->length; 276 276 277 277 block = tr_block( r->index, r->begin ); trunk/libtransmission/tracker.c
r920 r931 52 52 int bindPort; 53 53 int newPort; 54 55 uint64_t download;56 uint64_t upload;57 54 }; 58 55 … … 78 75 tc->bindPort = *(tor->bindPort); 79 76 tc->newPort = -1; 80 81 tc->download = tor->downloaded;82 tc->upload = tor->uploaded;83 77 84 78 return tc; … … 244 238 uint64_t up; 245 239 246 assert( tor->downloaded >= tc->download && tor->uploaded >= tc->upload ); 247 down = tor->downloaded - tc->download; 248 up = tor->uploaded - tc->upload; 240 down = tor->downloadedCur; 241 up = tor->uploadedCur; 249 242 if( tc->started ) 250 243 { … … 480 473 { 481 474 tc->started = 1; 482 tc->download = tor->downloaded;483 tc->upload = tor->uploaded;484 475 } 485 476 trunk/libtransmission/transmission.c
r929 r931 393 393 } 394 394 395 tor->downloadedPrev += tor->downloadedCur; 396 tor->downloadedCur = 0; 397 tor->uploadedPrev += tor->uploadedCur; 398 tor->uploadedCur = 0; 399 395 400 tor->status = TR_STATUS_CHECK; 396 401 tor->tracker = tr_trackerInit( tor ); … … 541 546 } 542 547 543 s->downloaded = tor->downloaded ;544 s->uploaded = tor->uploaded ;548 s->downloaded = tor->downloadedCur + tor->downloadedPrev; 549 s->uploaded = tor->uploadedCur + tor->uploadedPrev; 545 550 546 551 tr_lockUnlock( &tor->lock );
