BUG/MEDIUM: stconn: also consider SE_FL_EOI to switch to SE_FL_ERROR
authorWilly Tarreau <w@1wt.eu>
Tue, 17 Jan 2023 15:27:35 +0000 (16:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 17 Jan 2023 15:27:35 +0000 (16:27 +0100)
commite77f4306bad59b1f1303838215461cbc03a15ffe
tree03328f97bebde2e2c2bdf832cc275d9ef4825a7c
parent35c4dd0005a210597c2b96317c6f69e3fed4b171
BUG/MEDIUM: stconn: also consider SE_FL_EOI to switch to SE_FL_ERROR

In se_fl_set_error() we used to switch to SE_FL_ERROR only when there
is already SE_FL_EOS indicating that the read side is closed. But that
is not sufficient, we need to consider all cases where no more reads
will be performed on the connection, and as such also include SE_FL_EOI.

Without this, some aborted connections during a transfer sometimes only
stop after the timeout, because the ERR_PENDING is never promoted to
ERROR.

This must be backported to 2.7 and requires previous patch "CLEANUP:
stconn: always use se_fl_set_error() to set the pending error".
include/haproxy/stconn.h