From 2d6ebd0410c5084a78db2380f22041d4011ffd41 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Tue, 21 Apr 2026 14:58:53 +0200 Subject: [PATCH] MINOR: h3/hq_interop: implement stream reset on shut abort/kill-conn Adjust QUIC mux stream shut procedure when abort or kill-conn is performed. Changes are implemented directly into lclose callback for h3/h09 protocols. On abort, the stream is resetted as previously. The only change is that now a proper error code can be used, with REQUEST_CANCELLED specified for HTTP/3 protocol. Kill-conn is requested when a tcp-requect connection reject rule has been executed. In this case the stream is resetted, and the connection is also closed. This is identical to the H2 multiplexer. HTTP/3 protocol uses EXCESSIVE_LOAD as error code in this case. --- src/h3.c | 12 ++++++++++-- src/hq_interop.c | 10 ++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/h3.c b/src/h3.c index 8d633bfc7..ce5734ed5 100644 --- a/src/h3.c +++ b/src/h3.c @@ -3114,8 +3114,16 @@ static void h3_lclose(struct qcs *qcs, enum qcc_app_ops_lclose_mode mode) } break; - default: - qcc_reset_stream(qcs, 0, 0); + case QCC_APP_OPS_LCLO_MODE_ABORT: + qcc_reset_stream(qcs, H3_ERR_REQUEST_CANCELLED, se_tevt_type_cancelled); + break; + + case QCC_APP_OPS_LCLO_MODE_KILL_CONN: + qcc_reset_stream(qcs, H3_ERR_EXCESSIVE_LOAD, se_tevt_type_cancelled); + if (!(qcs->qcc->flags & (QC_CF_ERR_CONN|QC_CF_ERRL))) { + qcc_set_error(qcs->qcc, H3_ERR_EXCESSIVE_LOAD, 1, + muxc_tevt_type_graceful_shut); + } break; } diff --git a/src/hq_interop.c b/src/hq_interop.c index 35a0e3358..37298550d 100644 --- a/src/hq_interop.c +++ b/src/hq_interop.c @@ -331,8 +331,14 @@ static void hq_interop_lclose(struct qcs *qcs, enum qcc_app_ops_lclose_mode mode qcc_send_stream(qcs, 0, 0); break; - default: - qcc_reset_stream(qcs, 0, 0); + case QCC_APP_OPS_LCLO_MODE_ABORT: + qcc_reset_stream(qcs, 0, se_tevt_type_cancelled); + break; + + case QCC_APP_OPS_LCLO_MODE_KILL_CONN: + qcc_reset_stream(qcs, 0, se_tevt_type_cancelled); + if (!(qcs->qcc->flags & (QC_CF_ERR_CONN|QC_CF_ERRL))) + qcc_set_error(qcs->qcc, 0, 0, muxc_tevt_type_graceful_shut); break; } }