MEDIUM: proxy: make timeout parser a bit stricter

Twice in a week I found people were surprized by a "conditional timeout" not
being respected, because they add "if <cond>" after a timeout, and since
they don't see any error nor read the doc, the expect it to work. Let's
make the timeout parser reject extra arguments to avoid these situations.
This commit is contained in:
Willy Tarreau 2014-05-22 08:24:46 +02:00
parent efe282260e
commit fac5b5956b

View File

@ -233,6 +233,11 @@ static int proxy_parse_timeout(char **args, int section, struct proxy *proxy,
}
}
if (*args[2] != 0) {
memprintf(err, "'timeout %s' : unexpected extra argument '%s' after value '%s'.", name, args[2], args[1]);
retval = -1;
}
*tv = MS_TO_TICKS(timeout);
return retval;
}