mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-13 09:11:06 +00:00
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.
This commit is contained in:
parent
2437377445
commit
b7209d42d9
@ -77,8 +77,14 @@ static forceinline void se_fl_setall(struct sedesc *se, uint all)
|
||||
se->flags = all;
|
||||
}
|
||||
|
||||
/* sets flags <on> on se->flags and handles ERR_PENDING to ERROR promotion if
|
||||
* needed (upon EOI/EOS).
|
||||
*/
|
||||
static forceinline void se_fl_set(struct sedesc *se, uint on)
|
||||
{
|
||||
if (((on & (SE_FL_EOS|SE_FL_EOI)) && se->flags & SE_FL_ERR_PENDING) ||
|
||||
((on & SE_FL_ERR_PENDING) && se->flags & (SE_FL_EOI|SE_FL_EOS)))
|
||||
on |= SE_FL_ERROR;
|
||||
se->flags |= on;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user