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.
(cherry picked from commit 321d100cc8f86e5713fa7325acb30ef0e962d900)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 244e18af777b0196cd7efda6601edae999aac888)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit b5eb82bb191c9581298a9b377ed0ce928ad681e9)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/sink.c b/src/sink.c
index b75da34..35b29ba 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -881,7 +881,7 @@
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;