diff options
Diffstat (limited to 'opentracker.c')
| -rw-r--r-- | opentracker.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/opentracker.c b/opentracker.c index eea02eb..403fa21 100644 --- a/opentracker.c +++ b/opentracker.c | |||
| @@ -26,9 +26,6 @@ | |||
| 26 | #include "trackerlogic.h" | 26 | #include "trackerlogic.h" |
| 27 | #include "scan_urlencoded_query.h" | 27 | #include "scan_urlencoded_query.h" |
| 28 | 28 | ||
| 29 | unsigned int const OT_CLIENT_TIMEOUT = 30; | ||
| 30 | unsigned int const OT_CLIENT_TIMEOUT_CHECKINTERVAL = 5; | ||
| 31 | |||
| 32 | static unsigned int ot_overall_connections = 0; | 29 | static unsigned int ot_overall_connections = 0; |
| 33 | static unsigned int ot_overall_successfulannounces = 0; | 30 | static unsigned int ot_overall_successfulannounces = 0; |
| 34 | static time_t ot_start_time; | 31 | static time_t ot_start_time; |
| @@ -346,7 +343,7 @@ e400_param: | |||
| 346 | 343 | ||
| 347 | if( OT_FLAG( &peer ) & PEER_FLAG_STOPPED ) { | 344 | if( OT_FLAG( &peer ) & PEER_FLAG_STOPPED ) { |
| 348 | remove_peer_from_torrent( hash, &peer ); | 345 | remove_peer_from_torrent( hash, &peer ); |
| 349 | memmove( static_scratch + SUCCESS_HTTP_HEADER_LENGTH, "d8:completei0e10:incompletei0e8:intervali1800e5:peers0:e", reply_size = 56 ); | 346 | reply_size = sprintf( static_scratch + SUCCESS_HTTP_HEADER_LENGTH, "d8:completei0e10:incompletei0e8:intervali%ie5:peers0:e", OT_CLIENT_REQUEST_INTERVAL_RANDOM ); |
| 350 | } else { | 347 | } else { |
| 351 | torrent = add_peer_to_torrent( hash, &peer ); | 348 | torrent = add_peer_to_torrent( hash, &peer ); |
| 352 | if( !torrent ) { | 349 | if( !torrent ) { |
| @@ -511,7 +508,7 @@ void handle_accept( int64 serversocket ) { | |||
| 511 | while( ( i = socket_accept4( serversocket, (char*)ip, &port) ) != -1 ) { | 508 | while( ( i = socket_accept4( serversocket, (char*)ip, &port) ) != -1 ) { |
| 512 | 509 | ||
| 513 | if( !io_fd( i ) || | 510 | if( !io_fd( i ) || |
| 514 | !( h = (struct http_data*)malloc( sizeof struct http_data ) ) ) { | 511 | !( h = (struct http_data*)malloc( sizeof( struct http_data ) ) ) ) { |
| 515 | io_close( i ); | 512 | io_close( i ); |
| 516 | continue; | 513 | continue; |
| 517 | } | 514 | } |
