]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: close on qcs allocation failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 9 Mar 2023 09:16:09 +0000 (10:16 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Mar 2023 13:39:49 +0000 (14:39 +0100)
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

index c67432391dea5824b65b50419a78524d60c268d8..c254c2599435e4a7c478911c47e1768424058465 100644 (file)
@@ -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;
                }