]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: do not consider CONNECTION_CLOSE for the moment
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 1 Feb 2022 14:15:11 +0000 (15:15 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 1 Feb 2022 14:19:35 +0000 (15:19 +0100)
Remove the condition on CONNECTION_CLOSE reception to close immediately
streams. It can cause some crash as the QUIC xprt layer still access the
qcs to send data and handle ACK.

The whole interface and buffering between QUIC xprt and mux must be
properly reorganized to better handle this case. Once this is done, it
may have some sense to free the qcs streams on CONNECTION_CLOSE
reception.

src/mux_quic.c

index bdb15cefa6fde2a81d758300ca5e551398fcbcaf..9efb2f232d114582a0b03de1ce3406ca40405d16 100644 (file)
@@ -355,8 +355,7 @@ static int qc_release_detached_streams(struct qcc *qcc)
                node = eb64_next(node);
 
                if (qcs->flags & QC_SF_DETACH) {
-                       if ((!b_data(&qcs->tx.buf) && !b_data(&qcs->tx.xprt_buf)) ||
-                           qcc->flags & QC_CF_CC_RECV) {
+                       if ((!b_data(&qcs->tx.buf) && !b_data(&qcs->tx.xprt_buf))) {
                                qcs_destroy(qcs);
                                release = 1;
                        }
@@ -466,8 +465,12 @@ static void qc_detach(struct conn_stream *cs)
        fprintf(stderr, "%s: leaving with tx.buf.data=%lu, tx.xprt_buf.data=%lu\n",
                __func__, b_data(&qcs->tx.buf), b_data(&qcs->tx.xprt_buf));
 
-       if ((b_data(&qcs->tx.buf) || b_data(&qcs->tx.xprt_buf)) &&
-           !(qcc->flags & QC_CF_CC_RECV)) {
+       /* TODO on CONNECTION_CLOSE reception, it should be possible to free
+        * qcs instances. This should be done once the buffering and ACK
+        * managment between xprt and mux is reorganized.
+        */
+
+       if ((b_data(&qcs->tx.buf) || b_data(&qcs->tx.xprt_buf))) {
                qcs->flags |= QC_SF_DETACH;
                return;
        }