summaryrefslogtreecommitdiff
path: root/trackerlogic.c
diff options
context:
space:
mode:
Diffstat (limited to 'trackerlogic.c')
-rw-r--r--trackerlogic.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/trackerlogic.c b/trackerlogic.c
index c18f13a..bc9010e 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -347,7 +347,6 @@ size_t return_fullscrape_for_tracker( char **reply ) {
347 size_t torrent_count = 0, j; 347 size_t torrent_count = 0, j;
348 int i, k; 348 int i, k;
349 char *r; 349 char *r;
350 time_t time_now = NOW;
351 350
352 for( i=0; i<256; ++i ) { 351 for( i=0; i<256; ++i ) {
353 ot_vector *torrents_list = &all_torrents[i]; 352 ot_vector *torrents_list = &all_torrents[i];
@@ -363,12 +362,11 @@ size_t return_fullscrape_for_tracker( char **reply ) {
363 ot_peerlist *peer_list = ( ((ot_torrent*)(torrents_list->data))[j] ).peer_list; 362 ot_peerlist *peer_list = ( ((ot_torrent*)(torrents_list->data))[j] ).peer_list;
364 ot_hash *hash =&( ((ot_torrent*)(torrents_list->data))[j] ).hash; 363 ot_hash *hash =&( ((ot_torrent*)(torrents_list->data))[j] ).hash;
365 size_t peers = 0, seeds = 0; 364 size_t peers = 0, seeds = 0;
366 clean_peerlist( time_now, peer_list );
367 for( k=0; k<OT_POOLS_COUNT; ++k ) { 365 for( k=0; k<OT_POOLS_COUNT; ++k ) {
368 peers += peer_list->peers[k].size; 366 peers += peer_list->peers[k].size;
369 seeds += peer_list->seed_count[k]; 367 seeds += peer_list->seed_count[k];
370 } 368 }
371 memmove( r, "20:", 3 ); r+=3; 369 *r++='2'; *r++='0'; *r++=':';
372 memmove( r, hash, 20 ); r+=20; 370 memmove( r, hash, 20 ); r+=20;
373 r += sprintf( r, "d8:completei%zde10:downloadedi%zde10:incompletei%zdee", seeds, peer_list->downloaded, peers-seeds ); 371 r += sprintf( r, "d8:completei%zde10:downloadedi%zde10:incompletei%zdee", seeds, peer_list->downloaded, peers-seeds );
374 } 372 }