From 321d100cc8f86e5713fa7325acb30ef0e962d900 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 19 Oct 2022 16:26:21 +0200 Subject: [PATCH] BUG/MINOR: ring: Properly parse connect timeout 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sink.c b/src/sink.c index 29c38764d..23cffc676 100644 --- a/src/sink.c +++ b/src/sink.c @@ -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;