mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-21 14:17:30 -04:00
MINOR: ring: support unit suffixes in the size
The ring size used to take only numbers and silently ignore letters (due to atol()), resulting it tiny buffers when trying to collect traces and using e.g. "size 10g". Let's make use of parse_size_err() to properly parse units.
This commit is contained in:
parent
82f190f882
commit
f8d3d2e4cf
1 changed files with 1 additions and 2 deletions
|
|
@ -976,8 +976,7 @@ int cfg_parse_ring(const char *file, int linenum, char **args, int kwm)
|
|||
goto err;
|
||||
}
|
||||
|
||||
size = atol(args[1]);
|
||||
if (!size) {
|
||||
if (parse_size_err(args[1], &size) != NULL || !size) {
|
||||
ha_alert("parsing [%s:%d] : invalid size '%s' for new sink buffer.\n", file, linenum, args[1]);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue