diff options
author | Amaury Denoyelle <adenoyelle@haproxy.com> | 2023-05-10 10:41:47 +0200 |
---|---|---|
committer | Amaury Denoyelle <adenoyelle@haproxy.com> | 2023-05-11 14:04:51 +0200 |
commit | 3fd40935d91e315e95ba03304d46f9dffb3ff395 (patch) | |
tree | ca37308f61e6890091e6ba1d774ff3ea56d08558 | |
parent | 9615102b01b45ab9e643b184fa2bb3d1e175ea11 (diff) | |
download | haproxy-3fd40935d91e315e95ba03304d46f9dffb3ff395.tar.gz |
BUG/MINOR: mux-quic: do not prevent shutw on error
Since recent modification of MUX error processing, shutw operation was
skipped for a connection reported as on error. However, this can caused
the stream layer to not be notified about error. The impact of this bug
is unknown but it may lead to stream never closed.
To fix this, simply skip over send operations when connection is on
error while keep notifying the stream layer.
This should be backported up to 2.7.
-rw-r--r-- | src/mux_quic.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mux_quic.c b/src/mux_quic.c index 6746fc87e..785f7b4b0 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -2738,24 +2738,23 @@ static void qc_shutw(struct stconn *sc, enum co_shw_mode mode) TRACE_ENTER(QMUX_EV_STRM_SHUT, qcc->conn, qcs); - if (qcc->flags & QC_CF_ERRL) { - TRACE_DEVEL("connection on error", QMUX_EV_QCC_END, qcc->conn); - goto out; - } - /* Early closure reported if QC_SF_FIN_STREAM not yet set. */ if (!qcs_is_close_local(qcs) && !(qcs->flags & (QC_SF_FIN_STREAM|QC_SF_TO_RESET))) { if (qcs->flags & QC_SF_UNKNOWN_PL_LENGTH) { /* Close stream with a FIN STREAM frame. */ - TRACE_STATE("set FIN STREAM", QMUX_EV_STRM_SHUT, qcc->conn, qcs); - qcs->flags |= QC_SF_FIN_STREAM; - qcc_send_stream(qcs, 0); + if (!(qcc->flags & QC_CF_ERRL)) { + TRACE_STATE("set FIN STREAM", + QMUX_EV_STRM_SHUT, qcc->conn, qcs); + qcs->flags |= QC_SF_FIN_STREAM; + qcc_send_stream(qcs, 0); + } } else { /* RESET_STREAM necessary. */ - qcc_reset_stream(qcs, 0); + if (!(qcc->flags & QC_CF_ERRL)) + qcc_reset_stream(qcs, 0); se_fl_set_error(qcs->sd); } |