]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: h3/hq_interop: implement stream reset on shut abort/kill-conn
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 21 Apr 2026 12:58:53 +0000 (14:58 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 30 Apr 2026 15:18:20 +0000 (17:18 +0200)
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
src/hq_interop.c

index 8d633bfc7075b2122a447ef30e269716b80cc377..ce5734ed59e831d83235c7e1f87d60d97d0ad7d0 100644 (file)
--- 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;
        }
 
index 35a0e3358f8e7f4c27df4b1eaf2dff91d3a30f53..37298550da451ae9ecad00d7a0c4bf66a6765fc2 100644 (file)
@@ -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;
        }
 }