From be825f57597b0e9dcf07d257e93f03e30935f7db Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Thu, 24 Nov 2022 04:20:06 +0100 Subject: Add support for dynamic accesslists --- opentracker.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'opentracker.c') diff --git a/opentracker.c b/opentracker.c index a5ba7d3..b6d2bb9 100644 --- a/opentracker.c +++ b/opentracker.c @@ -135,8 +135,8 @@ static void help( char *name ) { } #undef HELPLINE -static size_t header_complete( char * request, ssize_t byte_count ) { - int i = 0, state = 0; +static ssize_t header_complete( char * request, ssize_t byte_count ) { + ssize_t i = 0, state = 0; for( i=1; i < byte_count; i+=2 ) if( request[i] <= 13 ) { @@ -184,7 +184,7 @@ static void handle_read( const int64 sock, struct ot_workstruct *ws ) { ws->request_size = byte_count; http_handle_request( sock, ws ); } else - array_catb( &cookie->request, ws->inbuf, byte_count ); + array_catb( &cookie->request, ws->inbuf, (size_t)byte_count ); return; } @@ -463,6 +463,12 @@ int parse_configfile( char * config_filename ) { } else if(!byte_diff(p, 16, "access.blacklist" ) && isspace(p[16])) { set_config_option( &g_accesslist_filename, p+17 ); #endif +#ifdef WANT_DYNAMIC_ACCESSLIST + } else if(!byte_diff(p, 15, "access.fifo_add" ) && isspace(p[15])) { + set_config_option( &g_accesslist_pipe_add, p+16 ); + } else if(!byte_diff(p, 18, "access.fifo_delete" ) && isspace(p[18])) { + set_config_option( &g_accesslist_pipe_delete, p+19 ); +#endif #ifdef WANT_RESTRICT_STATS } else if(!byte_diff(p, 12, "access.stats" ) && isspace(p[12])) { if( !scan_ip6( p+13, tmpip )) goto parse_error; -- cgit v1.2.3