]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h3: hardcode the stream id of control stream
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 9 Feb 2022 09:28:53 +0000 (10:28 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 9 Feb 2022 14:05:23 +0000 (15:05 +0100)
Use the value of 0x3 for the stream-id of H3 control-stream. As a
consequence, qcs_get_next_id is now unused and is thus removed.

include/haproxy/mux_quic.h
src/h3.c

index 5abb1df9fa2bfa88791bfb5a885fcbe964ac2ee7..4452076f08cb71d4475badbe27e7eb4274e698f0 100644 (file)
@@ -46,12 +46,6 @@ static inline int qc_local_stream_id(struct qcc *qcc, uint64_t id)
        return id & QCS_ID_SRV_INTIATOR_BIT;
 }
 
-static inline int qcs_get_next_id(struct qcc *qcc, enum qcs_type type)
-{
-       BUG_ON(qcc->strms[type].nb_streams + 1 > qcc->strms[type].max_streams);
-       return (qcc->strms[type].nb_streams++ << QCS_ID_TYPE_SHIFT) | type;
-}
-
 struct eb64_node *qcc_get_qcs(struct qcc *qcc, uint64_t id);
 
 /* Install the <app_ops> applicative layer of a QUIC connection on mux <qcc>.
index 79d746001571085a754b6fba36e92c3a8272a50a..d72f082e2d9860a86d5beb72e686d6f0954022fa 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -706,10 +706,8 @@ static int h3_attach_ruqs(struct qcs *qcs, void *ctx)
 static int h3_finalize(void *ctx)
 {
        struct h3 *h3 = ctx;
-       int lctrl_id;
 
-       lctrl_id = qcs_get_next_id(h3->qcc, QCS_SRV_UNI);
-       h3->lctrl.qcs = qcs_new(h3->qcc, lctrl_id, QCS_SRV_UNI);
+       h3->lctrl.qcs = qcs_new(h3->qcc, 0x3, QCS_SRV_UNI);
        if (!h3->lctrl.qcs)
                return 0;