diff options
Diffstat (limited to 'opentracker.c')
| -rw-r--r-- | opentracker.c | 11 |
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 |
