Commit c20ad0d8dbd1bb5707bbfe23632415c3062e046c (BUG/MINOR: tools:  make
parse_time_err() more strict on the timer validity) broke parsing the "us"
unit in timers. It caused `parse_time_err()` to return the string "s",
which indicates an error.

Now if the "u" is followed by an "s" we properly continue processing the
time instead of immediately failing.

This fixes https://github.com/haproxy/haproxy/issues/1209
---
 src/tools.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/tools.c b/src/tools.c
index 546ad4416..4924ad1a0 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -2326,6 +2326,7 @@ const char *parse_time_err(const char *text, unsigned 
*ret, unsigned unit_flags)
                if (text[1] == 's') {
                        idiv = 1000000;
                        text++;
+                       break;
                }
                return text;
        case 'm': /* millisecond : "ms" or minute: "m" */
--
2.31.1


Reply via email to