diff options
Diffstat (limited to 'opentracker.c')
-rw-r--r-- | opentracker.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/opentracker.c b/opentracker.c index af4db14..ecc2c9c 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -30,10 +30,10 @@ | |||
30 | #include "scan_urlencoded_query.h" | 30 | #include "scan_urlencoded_query.h" |
31 | 31 | ||
32 | /* Globals */ | 32 | /* Globals */ |
33 | static unsigned int ot_overall_tcp_connections = 0; | 33 | static unsigned long long ot_overall_tcp_connections = 0; |
34 | static unsigned int ot_overall_udp_connections = 0; | 34 | static unsigned long long ot_overall_udp_connections = 0; |
35 | static unsigned int ot_overall_tcp_successfulannounces = 0; | 35 | static unsigned long long ot_overall_tcp_successfulannounces = 0; |
36 | static unsigned int ot_overall_udp_successfulannounces = 0; | 36 | static unsigned long long ot_overall_udp_successfulannounces = 0; |
37 | static time_t ot_start_time; | 37 | static time_t ot_start_time; |
38 | static const size_t SUCCESS_HTTP_HEADER_LENGTH = 80; | 38 | static const size_t SUCCESS_HTTP_HEADER_LENGTH = 80; |
39 | static const size_t SUCCESS_HTTP_SIZE_OFF = 17; | 39 | static const size_t SUCCESS_HTTP_SIZE_OFF = 17; |
@@ -285,14 +285,14 @@ static void httpresponse( const int64 s, char *data ) { | |||
285 | case STATS_UDP: | 285 | case STATS_UDP: |
286 | t = time( NULL ) - ot_start_time; | 286 | t = time( NULL ) - ot_start_time; |
287 | reply_size = sprintf( static_outbuf + SUCCESS_HTTP_HEADER_LENGTH, | 287 | reply_size = sprintf( static_outbuf + SUCCESS_HTTP_HEADER_LENGTH, |
288 | "%i\n%i\n%i seconds (%i hours)\nopentracker udp4 stats.", | 288 | "%llu\n%llu\n%i seconds (%i hours)\nopentracker udp4 stats.", |
289 | ot_overall_udp_connections, ot_overall_udp_successfulannounces, (int)t, (int)(t / 3600) ); | 289 | ot_overall_udp_connections, ot_overall_udp_successfulannounces, (int)t, (int)(t / 3600) ); |
290 | break; | 290 | break; |
291 | 291 | ||
292 | case STATS_TCP: | 292 | case STATS_TCP: |
293 | t = time( NULL ) - ot_start_time; | 293 | t = time( NULL ) - ot_start_time; |
294 | reply_size = sprintf( static_outbuf + SUCCESS_HTTP_HEADER_LENGTH, | 294 | reply_size = sprintf( static_outbuf + SUCCESS_HTTP_HEADER_LENGTH, |
295 | "%i\n%i\n%i seconds (%i hours)\nopentracker tcp4 stats.", | 295 | "%llu\n%llu\n%i seconds (%i hours)\nopentracker tcp4 stats.", |
296 | ot_overall_tcp_connections, ot_overall_tcp_successfulannounces, (int)t, (int)(t / 3600) ); | 296 | ot_overall_tcp_connections, ot_overall_tcp_successfulannounces, (int)t, (int)(t / 3600) ); |
297 | break; | 297 | break; |
298 | 298 | ||
@@ -445,8 +445,8 @@ ANNOUNCE_WORKAROUND: | |||
445 | 445 | ||
446 | t = time( NULL ) - ot_start_time; | 446 | t = time( NULL ) - ot_start_time; |
447 | reply_size = sprintf( static_outbuf + SUCCESS_HTTP_HEADER_LENGTH, | 447 | reply_size = sprintf( static_outbuf + SUCCESS_HTTP_HEADER_LENGTH, |
448 | "%i\n%i\n%i seconds (%i hours)\nopentracker - Pretuned by german engineers, currently handling %i connections per second.", | 448 | "%llu\n%llu\n%i seconds (%i hours)\nopentracker - Pretuned by german engineers, currently handling %llu connections per second.", |
449 | ot_overall_tcp_connections+ot_overall_udp_connections, ot_overall_tcp_successfulannounces+ot_overall_udp_successfulannounces, (int)t, (int)(t / 3600), (int)ot_overall_tcp_connections / ( (int)t ? (int)t : 1 ) ); | 449 | ot_overall_tcp_connections+ot_overall_udp_connections, ot_overall_tcp_successfulannounces+ot_overall_udp_successfulannounces, (int)t, (int)(t / 3600), ot_overall_tcp_connections / ( (unsigned int)t ? (unsigned int)t : 1 ) ); |
450 | break; | 450 | break; |
451 | case 12: | 451 | case 12: |
452 | if( byte_diff( data, 12, "announce.php" ) ) HTTPERROR_404; | 452 | if( byte_diff( data, 12, "announce.php" ) ) HTTPERROR_404; |