diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-09-16 20:08:24 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-09-16 20:08:24 +0000 |
commit | a8f0272ace665b66b671574e69c64f840d5248e2 (patch) | |
tree | 3ff8b027e828f80a234cb4c2d53f52daa96e0ed2 /src | |
parent | ec9068fae8aec2024251fac02b298c00076013ba (diff) | |
download | tinyproxy-a8f0272ace665b66b671574e69c64f840d5248e2.tar.gz tinyproxy-a8f0272ace665b66b671574e69c64f840d5248e2.zip |
Added the token for Upstream and the code the handle the upstream
directive in the configuration file.
Diffstat (limited to '')
-rw-r--r-- | src/grammar.y | 14 | ||||
-rw-r--r-- | src/scanner.l | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/grammar.y b/src/grammar.y index f3c07d1..8e3f324 100644 --- a/src/grammar.y +++ b/src/grammar.y @@ -1,4 +1,4 @@ -/* $Id: grammar.y,v 1.4 2001-08-26 21:08:36 rjkaes Exp $ +/* $Id: grammar.y,v 1.5 2001-09-16 20:08:24 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 @@ -44,7 +44,8 @@ int yylex(void); %token KW_MAXREQUESTSPERCHILD %token KW_TIMEOUT %token KW_USER KW_GROUP -%token KW_ANONYMOUS KW_FILTER KW_XTINYPROXY KW_TUNNEL +%token KW_ANONYMOUS KW_FILTER KW_XTINYPROXY +%token KW_TUNNEL KW_UPSTREAM %token KW_ALLOW KW_DENY /* yes/no switches */ @@ -124,6 +125,15 @@ statement log_message(LOG_WARNING, "Tunnel support was not compiled in."); #endif } + | KW_UPSTREAM unique_address ':' NUMBER + { +#ifdef UPSTREAM_SUPPORT + config.upstream_name = $2; + config.upstream_port = $4; +#else + log_message(LOG_WARNING, "Upstream proxy support was not compiled in."); +#endif + } | KW_LISTEN NUMERIC_ADDRESS { config.ipAddr = $2; } | KW_ALLOW network_address { insert_acl($2, ACL_ALLOW); } | KW_DENY network_address { insert_acl($2, ACL_DENY); } diff --git a/src/scanner.l b/src/scanner.l index 5c4a975..ab87b39 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -1,4 +1,4 @@ -/* $Id: scanner.l,v 1.4 2001-08-26 21:08:36 rjkaes Exp $ +/* $Id: scanner.l,v 1.5 2001-09-16 20:08:24 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 @@ -47,6 +47,7 @@ static struct keyword keywords[] = { { "filter", KW_FILTER }, { "xtinyproxy", KW_XTINYPROXY }, { "tunnel", KW_TUNNEL }, + { "upstream", KW_UPSTREAM }, { "allow", KW_ALLOW }, { "deny", KW_DENY }, |