From c0c6b6d8c0f11f2106d881df09140b0e429251e9 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 9 Mar 2023 10:16:09 +0100 Subject: [PATCH] MINOR: mux-quic: close on qcs allocation failure Emit a CONNECTION_CLOSE with INTERNAL_ERROR code each time qcs allocation fails. This can happen in two cases : * when creating a local stream through application layer * when instantiating a remote stream through qcc_get_qcs() In both cases, error paths are already in place to interrupt the current operation and a CONNECTION_CLOSE will be emitted soon after. This should be backported up to 2.7. --- src/mux_quic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mux_quic.c b/src/mux_quic.c index c674323..c254c25 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -538,6 +538,7 @@ struct qcs *qcc_init_stream_local(struct qcc *qcc, int bidi) qcs = qcs_new(qcc, *next, type); if (!qcs) { TRACE_LEAVE(QMUX_EV_QCS_NEW, qcc->conn); + qcc_emit_cc(qcc, QC_ERR_INTERNAL_ERROR); return NULL; } @@ -597,8 +598,8 @@ static struct qcs *qcc_init_stream_remote(struct qcc *qcc, uint64_t id) qcs = qcs_new(qcc, *largest, type); if (!qcs) { - /* TODO emit RESET_STREAM */ TRACE_ERROR("stream fallocation failure", QMUX_EV_QCS_NEW, qcc->conn); + qcc_emit_cc(qcc, QC_ERR_INTERNAL_ERROR); goto err; } -- 1.7.10.4