]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ring: Properly parse connect timeout
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 19 Oct 2022 14:26:21 +0000 (16:26 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 20 Oct 2022 07:03:19 +0000 (09:03 +0200)
The connect timeout in a ring section was not properly parsed. Thus, it was
never set and the server timeout may be overwritten, depending on the
directives order. The first char of the keyword must be tested, not the
third one.

This patch is related to the issue #1900. But it does not fix the issue. It
must be backported as far as 2.4.

src/sink.c

index 29c38764db973c9cb8d0bd7e8f0eb4550978dc78..23cffc67674e7415c2e3604ec9bd06d20225268f 100644 (file)
@@ -994,7 +994,7 @@ int cfg_parse_ring(const char *file, int linenum, char **args, int kwm)
                                err_code |= ERR_ALERT | ERR_FATAL;
                                goto err;
                        }
-                        if (args[1][2] == 'c')
+                        if (args[1][0] == 'c')
                                 cfg_sink->forward_px->timeout.connect = tout;
                         else
                                 cfg_sink->forward_px->timeout.server = tout;