From 9297967f8523f1ac22bbac1823529b970a07cf56 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Wed, 4 Mar 2009 14:35:21 +0000 Subject: Add a stat option the count bucket stalls Add an iterator for all torrents. It's slower but for stats it's okay. Move some stats collection stuff to the new iterator. More to come. Start a "report all stats" page. Start fixing the code to identify "busy" networks. Add the concept of hosts allowed to proxy. Add a parser for the X-Forwarded-For: HTTP header. Clean up HTTP Header handling code. (Remove some left overs of now vanished sync code). --- opentracker.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'opentracker.c') diff --git a/opentracker.c b/opentracker.c index b839efc..c67e331 100644 --- a/opentracker.c +++ b/opentracker.c @@ -135,12 +135,10 @@ static ssize_t handle_read( const int64 sock, struct ot_workstruct *ws ) { array_catb( &cookie->data.request, ws->inbuf, byte_count ); - if( array_failed( &cookie->data.request ) ) + if( array_failed( &cookie->data.request ) || + array_bytes( &cookie->data.request ) > 8192 ) return http_issue_error( sock, ws, CODE_HTTPERROR_500 ); - if( array_bytes( &cookie->data.request ) > 8192 ) - return http_issue_error( sock, ws, CODE_HTTPERROR_500 ); - if( !memchr( array_start( &cookie->data.request ), '\n', array_bytes( &cookie->data.request ) ) ) return 0; @@ -369,6 +367,11 @@ int parse_configfile( char * config_filename ) { } else if(!byte_diff(p, 12, "access.stats" ) && isspace(p[12])) { if( !scan_ip6( p+13, tmpip )) goto parse_error; accesslist_blessip( tmpip, OT_PERMISSION_MAY_STAT ); +#endif +#ifdef WANT_IP_FROM_PROXY + } else if(!byte_diff(p, 12, "access.proxy" ) && isspace(p[12])) { + if( !scan_ip6( p+13, tmpip )) goto parse_error; + accesslist_blessip( tmpip, OT_PERMISSION_MAY_PROXY ); #endif } else if(!byte_diff(p, 20, "tracker.redirect_url" ) && isspace(p[20])) { set_config_option( &g_redirecturl, p+21 ); -- cgit v1.2.3