]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: mux-quic: wake up xprt on data transferred
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 3 Dec 2021 13:39:29 +0000 (14:39 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 7 Dec 2021 14:44:45 +0000 (15:44 +0100)
On qc_send, data are transferred for each stream from their qcs.buf to
the qcs.xprt_buf. Wake up the xprt to warn about new data available for
transmission.

src/mux_quic.c

index 1f49e010c80f97b57e14b340d1faaf20c35e2b1e..c11e1cedd30826048bcabae3b92dea86c4f48f5b 100644 (file)
@@ -164,6 +164,7 @@ static int qcs_push_frame(struct qcs *qcs, struct buffer *payload, int fin, uint
 static int qc_send(struct qcc *qcc)
 {
        struct eb64_node *node;
+       int xprt_wake = 0;
        int ret;
 
        fprintf(stderr, "%s\n", __func__);
@@ -190,10 +191,10 @@ static int qc_send(struct qcc *qcc)
                        if (ret < 0)
                                ABORT_NOW();
 
-                       if (ret > 0)
+                       if (ret > 0) {
                                qcs_notify_send(qcs);
-
-                       /* TODO wake-up xprt if data were transfered */
+                               xprt_wake = 1;
+                       }
 
                        fprintf(stderr, "%s ret=%d\n", __func__, ret);
                        qcs->tx.offset += ret;
@@ -206,6 +207,9 @@ static int qc_send(struct qcc *qcc)
                node = eb64_next(node);
        }
 
+       if (xprt_wake)
+               tasklet_wakeup(((struct ssl_sock_ctx *)(qcc->conn->xprt_ctx))->wait_event.tasklet);
+
        return ret;
 }