commit - 509d0509a50883a6f8407b63774f40dd1e41dadf
commit + a7a998ac9b5c17d6e689569d8284ac288c64bf09
blob - 2f85a660d177ee24bd720b00b0195502c7766fc8
blob + d6e2bd5c17c4e555851933288772291e929ca4aa
--- parse.y
+++ parse.y
%token <v.number> NUM
%type <v.number> bool proxy_port
-%type <v.string> string numberstring
+%type <v.string> string numberstring listen_addr
%%
| servbody servopt optnl
| servbody location optnl
| servbody proxy optnl
+ ;
+
+listen_addr : '*' { $$ = NULL; }
+ | STRING
;
servopt : ALIAS string {
| PARAM string '=' string {
add_param($2, $4);
}
- | LISTEN ON STRING PORT STRING {
+ | LISTEN ON listen_addr PORT STRING {
listen_on($3, $5);
free($3);
free($5);
}
- | LISTEN ON STRING PORT NUM {
+ | LISTEN ON listen_addr PORT NUM {
char portno[32];
int r;
struct addrinfo hints, *res, *res0;
int error;
- if (!strcmp(hostname, "*"))
- hostname = NULL;
-
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;