From 0a3aa456c798483cd5923fdf8ca1a852e1865c09 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Fri, 12 Dec 2025 10:03:37 +0100 Subject: [PATCH] TMP --- include/haproxy/mux_quic-t.h | 1 + src/mux_quic.c | 8 ++++++-- src/mux_quic_qos.c | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h index d82306a74..736de4bf5 100644 --- a/include/haproxy/mux_quic-t.h +++ b/include/haproxy/mux_quic-t.h @@ -247,6 +247,7 @@ struct qcc_app_ops { #define QC_CF_WAIT_HS 0x00000040 /* MUX init before QUIC handshake completed (0-RTT) */ #define QC_CF_QOS 0x00000080 #define QC_CF_QSTP_SENT 0x00000100 +#define QC_CF_QSTP_RECV 0x00000200 /* This function is used to report flags in debugging tools. Please reflect * below any single-bit flag addition above in the same order via the diff --git a/src/mux_quic.c b/src/mux_quic.c index 8408634d0..e7e5027e8 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -3054,7 +3054,8 @@ static int qcc_io_send(struct qcc *qcc) goto out; } - if (qcc->app_st < QCC_APP_ST_INIT) { + if (qcc->app_st < QCC_APP_ST_INIT && + (qmux_is_quic(qcc) || (qcc->flags & QC_CF_QSTP_RECV))) { if (qcc_app_init(qcc)) goto out; } @@ -3928,6 +3929,9 @@ static int qmux_init(struct connection *conn, struct proxy *prx, qcs->sd = sc->sedesc; qcc->nb_sc++; qcc->tot_sc++; + + if (!qmux_is_quic(qcc)) + tasklet_wakeup(qcc->wait_event.tasklet); } TRACE_LEAVE(QMUX_EV_QCC_NEW, conn); @@ -4682,6 +4686,6 @@ static const struct mux_ops qmux_qos_ops = { }; static struct mux_proto_list mux_proto_qos = - { .token = IST("qos"), .mode = PROTO_MODE_HTTP, .side = PROTO_SIDE_FE, .mux = &qmux_qos_ops }; + { .token = IST("qos"), .mode = PROTO_MODE_HTTP, .side = PROTO_SIDE_BOTH, .mux = &qmux_qos_ops }; INITCALL1(STG_REGISTER, register_mux_proto, &mux_proto_qos); diff --git a/src/mux_quic_qos.c b/src/mux_quic_qos.c index a214092ef..9b7d9fa2b 100644 --- a/src/mux_quic_qos.c +++ b/src/mux_quic_qos.c @@ -14,6 +14,7 @@ int qcc_qos_recv(struct qcc *qcc) { + /* TODO ajouter un buffer par connexion pour lecture des data incomplètes */ struct connection *conn = qcc->conn; struct quic_frame frm; const unsigned char *pos, *end; @@ -47,6 +48,8 @@ int qcc_qos_recv(struct qcc *qcc) qcc->rfctl.msd_uni_l = qs_tp_frm->tps.initial_max_stream_data_uni; fprintf(stderr, " initial_max_streams_bidi=%llu\n", (ullong)qs_tp_frm->tps.initial_max_streams_bidi); fprintf(stderr, " initial_max_streams_uni=%llu\n", (ullong)qs_tp_frm->tps.initial_max_streams_uni); + + qcc->flags |= QC_CF_QSTP_RECV; } else if (frm.type >= QUIC_FT_STREAM_8 && frm.type <= QUIC_FT_STREAM_F) { @@ -160,6 +163,7 @@ int qcc_qos_send_frames(struct qcc *qcc, struct list *frms, int stream) } else if (!LIST_ISEMPTY(frms) && !(qcc->wait_event.events & SUB_RETRY_SEND)) { conn->xprt->subscribe(conn, conn->xprt_ctx, SUB_RETRY_SEND, &qcc->wait_event); + return 1; } TRACE_LEAVE(QMUX_EV_QCC_SEND, qcc->conn);