]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-quic: refactor uni streams TX/send H3 SETTINGS
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 23 May 2022 09:39:14 +0000 (11:39 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 25 May 2022 13:41:25 +0000 (15:41 +0200)
Remove the unneeded skip over unidirectional streams in qc_send(). This
unify sending for both uni and bidi streams.

In fact, the only local unidirectional streams in use for the moment is
the H3 Control stream responsible of SETTINGS emission. The frame was
already properly generated in qcs.tx.buf, but not send due to stream
skip in qc_send(). Now, there is no need to ignore uni streams so remove
this condition.

This fixes the emission of H3 settings which is now properly emitted.

Uni and bidi streams use the same set of funtcions for sending. One of
the most notable gain is that flow-control is now enforced for uni
streams.

src/h3.c
src/mux_quic.c

index c2dfd00026891b72c49962d527173dda55ba4b56..317e6661181da0912d9a68dd9d27ffca09a817a9 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -870,7 +870,6 @@ static int h3_finalize(void *ctx)
        if (!h3c->lctrl.qcs)
                return 0;
 
-       /* Wakeup ->lctrl uni-stream */
        h3_control_send(&h3c->lctrl, h3c);
 
        return 1;
@@ -967,7 +966,7 @@ static int h3_init(struct qcc *qcc)
            !h3_uqs_init(&h3c->rctrl, h3c, h3_control_recv, h3_uqs_task))
                goto fail_no_h3_ruqs;
 
-       if (!h3_uqs_init(&h3c->lctrl, h3c, h3_control_send, h3_uqs_task) ||
+       if (!h3_uqs_init(&h3c->lctrl, h3c, NULL, h3_uqs_task) ||
            !h3_uqs_init(&h3c->lqpack_enc, h3c, NULL, h3_uqs_task) ||
            !h3_uqs_init(&h3c->lqpack_dec, h3c, NULL, h3_uqs_task))
                goto fail_no_h3_luqs;
index b7845a7c53293e48bf5005671037dce86bbf978d..c4c2e46b902d5817f06316cb53fdc86b4c733c52 100644 (file)
@@ -1104,14 +1104,12 @@ static int qc_send(struct qcc *qcc)
        node = eb64_first(&qcc->streams_by_id);
        while (node) {
                int ret;
+               uint64_t id;
+
                qcs = eb64_entry(node, struct qcs, by_id);
+               id = qcs->id;
 
-               /* TODO
-                * for the moment, unidirectional streams have their own
-                * mechanism for sending. This should be unified in the future,
-                * in this case the next check will be removed.
-                */
-               if (quic_stream_is_uni(qcs->id)) {
+               if (quic_stream_is_uni(id) && quic_stream_is_remote(qcc, id)) {
                        node = eb64_next(node);
                        continue;
                }