diff options
author | erdgeist <> | 2007-03-10 15:39:19 +0000 |
---|---|---|
committer | erdgeist <> | 2007-03-10 15:39:19 +0000 |
commit | e75c3e25cd1d33eecd8303f06365ae921141dfa6 (patch) | |
tree | f5a1f35b4abf335f15f3c7b809e4d492a0852e42 /trackerlogic.c | |
parent | 5b55394cdc4f3ab1daa784291f8b66b5c0c419de (diff) |
make full scrapes a bit faster, increase checkback time for udp
Diffstat (limited to 'trackerlogic.c')
-rw-r--r-- | trackerlogic.c | 4 |
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 | } |