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 08:35:12 +0000 (09:35 +0100)
commit761d1fb53d20b75f403c1b2032649fcab0e7f280
tree2a1419e75bd7e60f5da24baf3a242431d9c13540
parentac3b155e382c6490fb2b81318ebb98ab8a914690
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>
src/tools.c