]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: wake up after recv only if avail data
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 3 May 2023 13:30:04 +0000 (15:30 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 4 May 2023 14:36:51 +0000 (16:36 +0200)
When HTX content is transferred from qcs instance to upper stream
endpoint, a wakeup is conducted for MUX tasklet. However, this is only
necessary if demux was interrupted due to a full QCS HTX buffer.

This should be backported up to 2.7.

src/mux_quic.c

index 7adb121c8abaf98be412b678ab73c7e4001fb98f..3ed1c1333f8092d83b5d699895c1b82f6609dae7 100644 (file)
@@ -2574,7 +2574,14 @@ static size_t qc_recv_buf(struct stconn *sc, struct buffer *buf,
                }
        }
 
-       if (ret) {
+       /* Restart demux if it was interrupted on full buffer. */
+       if (ret && qcs->flags & QC_SF_DEM_FULL) {
+               /* There must be data left for demux if it was interrupted on
+                * full buffer. If this assumption is incorrect wakeup is not
+                * necessary.
+                */
+               BUG_ON(!ncb_data(&qcs->rx.ncbuf, 0));
+
                qcs->flags &= ~QC_SF_DEM_FULL;
                tasklet_wakeup(qcs->qcc->wait_event.tasklet);
        }