diff options
author | erdgeist <> | 2007-01-16 03:44:13 +0000 |
---|---|---|
committer | erdgeist <> | 2007-01-16 03:44:13 +0000 |
commit | 43b60783a1cfe39e58d08ccd858d93d9b5020a9c (patch) | |
tree | 9d17ce87f82353b8c7a17c4a8d7dd176f7c9dee8 | |
parent | ade82689709441f64ec871709d7ce95b14cd729c (diff) |
Use mrtg to do periodical cleanup. Hopefully that wont make too much load for stats.
-rw-r--r-- | testsuite.sh | 4 | ||||
-rw-r--r-- | 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 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | while true; do | 3 | while true; do |
4 | request_string="GET /announce?info_hash=0123456789012345678%$(printf %02X $(( $RANDOM & 0xff )) )&\ | 4 | request_string="GET /announce?info_hash=0123456789012345678%$(printf %02X $(( $RANDOM & 0xf )) )&\ |
5 | ip=10.1.1.$(( $RANDOM & 0xff ))&port=$(( $RANDOM & 0xff )) HTTP/1.0\n" | 5 | ip=10.1.1.$(( $RANDOM & 0xff ))&port=$(( $RANDOM & 0xff )) HTTP/1.0\n" |
6 | 6 | ||
7 | # echo -e $request_string | 7 | # echo -e $request_string |
8 | # echo | 8 | # echo |
9 | echo -e $request_string | nc 127.0.0.1 6969 >/dev/null & | 9 | echo -e $request_string | nc 127.0.0.1 6969 >/dev/null |
10 | # echo | 10 | # echo |
11 | 11 | ||
12 | done | 12 | 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 ) { | |||
321 | torrent_count += torrents_list->size; | 321 | torrent_count += torrents_list->size; |
322 | for( j=0; j<torrents_list->size; ++j ) { | 322 | for( j=0; j<torrents_list->size; ++j ) { |
323 | ot_peerlist *peer_list = ( ((ot_torrent*)(torrents_list->data))[j] ).peer_list; | 323 | ot_peerlist *peer_list = ( ((ot_torrent*)(torrents_list->data))[j] ).peer_list; |
324 | clean_peerlist( peer_list ); | ||
324 | for( k=0; k<OT_POOLS_COUNT; ++k ) { | 325 | for( k=0; k<OT_POOLS_COUNT; ++k ) { |
325 | peer_count += peer_list->peers[k].size; | 326 | peer_count += peer_list->peers[k].size; |
326 | seed_count += peer_list->seed_count[k]; | 327 | seed_count += peer_list->seed_count[k]; |