CLEANUP: stconn: always use se_fl_set_error() to set the pending error

In mux-h2 and mux-quic we still had two places manually setting
SE_FL_ERR_PENDING or SE_FL_ERROR depending on the EOS state, instead
of using se_fl_set_error() which takes care of the condition. Better
use the specialized function for this, it will allow to centralize
the conditions. Note that this will be needed to fix a bug.
This commit is contained in:
Willy Tarreau 2023-01-17 16:25:29 +01:00
parent 40725a4eb0
commit 35c4dd0005
2 changed files with 2 additions and 8 deletions

View File

@ -6477,10 +6477,7 @@ static size_t h2_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, in
!b_data(&h2s->h2c->dbuf) &&
(h2s->flags & (H2_SF_BLK_SFCTL | H2_SF_BLK_MFCTL))) {
TRACE_DEVEL("fctl with shutr, reporting error to app-layer", H2_EV_H2S_SEND|H2_EV_STRM_SEND|H2_EV_STRM_ERR, h2s->h2c->conn, h2s);
if (se_fl_test(h2s->sd, SE_FL_EOS))
se_fl_set(h2s->sd, SE_FL_ERROR);
else
se_fl_set(h2s->sd, SE_FL_ERR_PENDING);
se_fl_set_error(h2s->sd);
}
if (total > 0 && !(h2s->flags & H2_SF_BLK_SFCTL) &&

View File

@ -2394,10 +2394,7 @@ static int qc_wake_some_streams(struct qcc *qcc)
continue;
if (qcc->conn->flags & CO_FL_ERROR) {
se_fl_set(qcs->sd, SE_FL_ERR_PENDING);
if (se_fl_test(qcs->sd, SE_FL_EOS))
se_fl_set(qcs->sd, SE_FL_ERROR);
se_fl_set_error(qcs->sd);
qcs_alert(qcs);
}
}