mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
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:
parent
efe282260e
commit
fac5b5956b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user