BUG/MINOR: tools: make parse_time_err() more strict on the timer validity
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 11 Dec 2020 08:23:07 +0000 (09:23 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 14 Dec 2020 10:50:22 +0000 (11:50 +0100)
commit7ea3c0e533025e3c2685a2503b33dbc964363c17
treec95e18a105140f9fe9e34bf41e11298cda74d769
parentb0465e5ac92e4bdf56e9334cb4399abf82a16568
BUG/MINOR: tools: make parse_time_err() more strict on the timer validity

First, an error is now reported if the first character is not a digit. Thus,
"timeout client s" triggers an error now. Then 'u' is also rejected
now. 'us' is valid and should be used set the timer in microseconds. However
'u' alone is not a valid unit. It was just ignored before (default to
milliseconds). Now, it is an error. Finally, a warning is reported if the
end of the text is not reached after the timer parsing. This warning will
probably be switched to an error in a futur version.

This patch must be backported to all stable versions.

(cherry picked from commit c20ad0d8dbd1bb5707bbfe23632415c3062e046c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 761d1fb53d20b75f403c1b2032649fcab0e7f280)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 6c689a0aa32745becc1fa327ba358be7dafa160f)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/standard.c