summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
authorerdgeist <>2009-03-04 14:35:21 +0000
committererdgeist <>2009-03-04 14:35:21 +0000
commit9297967f8523f1ac22bbac1823529b970a07cf56 (patch)
tree0a6bc2a2d3ac9d38e53079040c7057c779e30f15 /opentracker.c
parent72a1564ca14392cc2e1d044554c6e86a0eda9409 (diff)
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).
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c11
1 files changed, 7 insertions, 4 deletions
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 ) {
135 135
136 array_catb( &cookie->data.request, ws->inbuf, byte_count ); 136 array_catb( &cookie->data.request, ws->inbuf, byte_count );
137 137
138 if( array_failed( &cookie->data.request ) ) 138 if( array_failed( &cookie->data.request ) ||
139 array_bytes( &cookie->data.request ) > 8192 )
139 return http_issue_error( sock, ws, CODE_HTTPERROR_500 ); 140 return http_issue_error( sock, ws, CODE_HTTPERROR_500 );
140 141
141 if( array_bytes( &cookie->data.request ) > 8192 )
142 return http_issue_error( sock, ws, CODE_HTTPERROR_500 );
143
144 if( !memchr( array_start( &cookie->data.request ), '\n', array_bytes( &cookie->data.request ) ) ) 142 if( !memchr( array_start( &cookie->data.request ), '\n', array_bytes( &cookie->data.request ) ) )
145 return 0; 143 return 0;
146 144
@@ -370,6 +368,11 @@ int parse_configfile( char * config_filename ) {
370 if( !scan_ip6( p+13, tmpip )) goto parse_error; 368 if( !scan_ip6( p+13, tmpip )) goto parse_error;
371 accesslist_blessip( tmpip, OT_PERMISSION_MAY_STAT ); 369 accesslist_blessip( tmpip, OT_PERMISSION_MAY_STAT );
372#endif 370#endif
371#ifdef WANT_IP_FROM_PROXY
372 } else if(!byte_diff(p, 12, "access.proxy" ) && isspace(p[12])) {
373 if( !scan_ip6( p+13, tmpip )) goto parse_error;
374 accesslist_blessip( tmpip, OT_PERMISSION_MAY_PROXY );
375#endif
373 } else if(!byte_diff(p, 20, "tracker.redirect_url" ) && isspace(p[20])) { 376 } else if(!byte_diff(p, 20, "tracker.redirect_url" ) && isspace(p[20])) {
374 set_config_option( &g_redirecturl, p+21 ); 377 set_config_option( &g_redirecturl, p+21 );
375#ifdef WANT_SYNC_LIVE 378#ifdef WANT_SYNC_LIVE