BUG/MINOR: stconn: Handle abortonclose if backend connection was already set up
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 13 Nov 2023 18:16:09 +0000 (19:16 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 14 Nov 2023 10:01:51 +0000 (11:01 +0100)
commit9327e7efa73b2be17cf8fbe9ab735181a84839fb
treed6cbb932f073df68a81411285ca712d139ee1c4c
parent6a4591c3d09da3fbd949073a32285a4afaa6785d
BUG/MINOR: stconn: Handle abortonclose if backend connection was already set up

abortonclose option is a backend option, it should not be handle on frontend
side. Of course a frontend can also be a backend but the option should not
be handled too early because it is not necessarily the selected backend
(think about a listen proxy routing requests to another backend).

It is especially an issue when the abortonclose option is enabled in the
defaults section and disabled by the selected backend. Because in this case,
the option may still be enabled while it should not.

Thus, now we wait the backend connection was set up to handle the option. To
do so, we check the backend SC state. The option is ignored if it is in
ST_CS_INI state. For all other states, it means the backend was already
selected.

This patch could be backported as far as 2.2.
src/stconn.c