diff options
-rw-r--r-- | opentracker.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/opentracker.c b/opentracker.c index ae0de82..e57cc84 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -30,6 +30,7 @@ unsigned int const OT_CLIENT_TIMEOUT = 30; | |||
30 | unsigned int const OT_CLIENT_TIMEOUT_CHECKINTERVAL = 5; | 30 | unsigned int const OT_CLIENT_TIMEOUT_CHECKINTERVAL = 5; |
31 | 31 | ||
32 | static unsigned int ot_overall_connections = 0; | 32 | static unsigned int ot_overall_connections = 0; |
33 | static unsigned int ot_overall_successfulannounces = 0; | ||
33 | static time_t ot_start_time; | 34 | static time_t ot_start_time; |
34 | static const size_t SUCCESS_HTTP_HEADER_LENGTH = 80; | 35 | static const size_t SUCCESS_HTTP_HEADER_LENGTH = 80; |
35 | static const size_t SUCCESS_HTTP_SIZE_OFF = 17; | 36 | static const size_t SUCCESS_HTTP_SIZE_OFF = 17; |
@@ -359,6 +360,7 @@ e500: | |||
359 | if( ( reply_size = return_peers_for_torrent( torrent, numwant, SUCCESS_HTTP_HEADER_LENGTH + static_scratch ) ) <= 0 ) | 360 | if( ( reply_size = return_peers_for_torrent( torrent, numwant, SUCCESS_HTTP_HEADER_LENGTH + static_scratch ) ) <= 0 ) |
360 | goto e500; | 361 | goto e500; |
361 | } | 362 | } |
363 | ot_overall_successfulannounces++; | ||
362 | break; | 364 | break; |
363 | case 11: | 365 | case 11: |
364 | if( byte_diff(data,11,"mrtg_scrape")) | 366 | if( byte_diff(data,11,"mrtg_scrape")) |
@@ -367,7 +369,7 @@ e500: | |||
367 | time_t seconds_elapsed = time( NULL ) - ot_start_time; | 369 | time_t seconds_elapsed = time( NULL ) - ot_start_time; |
368 | reply_size = sprintf( static_scratch + SUCCESS_HTTP_HEADER_LENGTH, | 370 | reply_size = sprintf( static_scratch + SUCCESS_HTTP_HEADER_LENGTH, |
369 | "%i\n%i\nUp: %i seconds (%i hours)\nPretuned by german engineers, currently handling %i connections per second.", | 371 | "%i\n%i\nUp: %i seconds (%i hours)\nPretuned by german engineers, currently handling %i connections per second.", |
370 | ot_overall_connections, ot_overall_connections, (int)seconds_elapsed, | 372 | ot_overall_connections, ot_overall_successfulannounces, (int)seconds_elapsed, |
371 | (int)(seconds_elapsed / 3600), (int)ot_overall_connections / ( (int)seconds_elapsed ? (int)seconds_elapsed : 1 ) ); | 373 | (int)(seconds_elapsed / 3600), (int)ot_overall_connections / ( (int)seconds_elapsed ? (int)seconds_elapsed : 1 ) ); |
372 | } | 374 | } |
373 | break; | 375 | break; |