]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stconn: make the SE_FL_ERR_PENDING to ERROR transition systematic
authorWilly Tarreau <w@1wt.eu>
Tue, 23 May 2023 14:08:22 +0000 (16:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 23 May 2023 14:17:04 +0000 (16:17 +0200)
commitb7209d42d95c1e25774d094803db33a028b68179
treedee9668fe7daf668e62f135a0ba5bcdc539a6919
parent2437377445967b594c72cddf7fc36b80e0b1acb8
MEDIUM: stconn: make the SE_FL_ERR_PENDING to ERROR transition systematic

During a code audit of the various situations that promote ERR_PENDING to
ERROR, it appeared that:
  - all muxes use se_fl_set_error() to set it, which chooses either based
    on EOI/EOS presence ;
  - EOI/EOS that arrive late after ERR_PENDING were not systematically
    upgraded to ERROR

This results in confusion about how such ERROR or ERR_PENDING ought to
be handled, which is not quite desirable.

This patch adds a test to se_fl_set() to detect if we're setting EOI or
EOS while ERR_PENDING is present, or the other way around so that any
sequence of EOI/EOS <-> ERR_PENDING results in ERROR being set. This
way there will no longer be possible situations where ERROR is missing
while the other ones are set.
include/haproxy/stconn.h