From 43b60783a1cfe39e58d08ccd858d93d9b5020a9c Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Tue, 16 Jan 2007 03:44:13 +0000 Subject: Use mrtg to do periodical cleanup. Hopefully that wont make too much load for stats. --- testsuite.sh | 4 ++-- trackerlogic.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite.sh b/testsuite.sh index 6baeabb..e0981d1 100644 --- a/testsuite.sh +++ b/testsuite.sh @@ -1,12 +1,12 @@ #!/bin/sh while true; do - request_string="GET /announce?info_hash=0123456789012345678%$(printf %02X $(( $RANDOM & 0xff )) )&\ + request_string="GET /announce?info_hash=0123456789012345678%$(printf %02X $(( $RANDOM & 0xf )) )&\ ip=10.1.1.$(( $RANDOM & 0xff ))&port=$(( $RANDOM & 0xff )) HTTP/1.0\n" # echo -e $request_string # echo - echo -e $request_string | nc 127.0.0.1 6969 >/dev/null & + echo -e $request_string | nc 127.0.0.1 6969 >/dev/null # echo done diff --git a/trackerlogic.c b/trackerlogic.c index 0c78e16..7d5c16b 100644 --- a/trackerlogic.c +++ b/trackerlogic.c @@ -321,6 +321,7 @@ size_t return_stats_for_tracker( char *reply ) { torrent_count += torrents_list->size; for( j=0; jsize; ++j ) { ot_peerlist *peer_list = ( ((ot_torrent*)(torrents_list->data))[j] ).peer_list; + clean_peerlist( peer_list ); for( k=0; kpeers[k].size; seed_count += peer_list->seed_count[k]; -- cgit v1.2.3