Allow the URL for the statistic page to be controlled from the

configuration file, rather than being hard-coded in the program.
[John M Wright]
This commit is contained in:
Robert James Kaes 2003-03-13 21:42:46 +00:00
parent fa1480a3e1
commit 75dd0b22c4
2 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $Id: grammar.y,v 1.19 2003-03-13 21:28:37 rjkaes Exp $
/* $Id: grammar.y,v 1.20 2003-03-13 21:42:46 rjkaes Exp $
*
* This is the grammar for tinyproxy's configuration file. It needs to be
* in sync with scanner.l. If you know more about yacc and lex than I do
@ -52,6 +52,7 @@ int yylex(void);
%token KW_FILTER_CASESENSITIVE
%token KW_UPSTREAM
%token KW_CONNECTPORT KW_BIND KW_HTTP_VIA
%token KW_STATHOST
%token KW_ALLOW KW_DENY
%token KW_ERRORPAGE KW_DEFAULT_ERRORPAGE
%token KW_STATPAGE
@ -203,6 +204,11 @@ statement
config.via_http_header = FALSE;
}
}
| KW_STATHOST string
{
log_message(LOG_INFO, "Stathost is set to \"%s\"", $2);
config.stathost = $2;
}
;
loglevels

View File

@ -1,4 +1,4 @@
/* $Id: scanner.l,v 1.18 2003-03-13 21:28:36 rjkaes Exp $
/* $Id: scanner.l,v 1.19 2003-03-13 21:42:45 rjkaes Exp $
*
* This builds the scanner for the tinyproxy configuration file. This
* file needs to stay in sync with grammar.y. If someone knows lex and yacc
@ -55,6 +55,7 @@ static struct keyword keywords[] = {
{ "connectport", KW_CONNECTPORT },
{ "bind", KW_BIND },
{ "viaheader", KW_HTTP_VIA },
{ "stathost", KW_STATHOST },
{ "errorfile", KW_ERRORPAGE },
{ "defaulterrorfile", KW_DEFAULT_ERRORPAGE },
{ "statfile", KW_STATPAGE },