diff --git a/src/mux_quic.c b/src/mux_quic.c index a1cb66717..cce191bd7 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -1603,8 +1603,13 @@ static int qc_send_frames(struct qcc *qcc, struct list *frms) goto err; } - if (!qc_send_mux(qcc->conn->handle.qc, frms)) + if (!qc_send_mux(qcc->conn->handle.qc, frms)) { + /* TODO should subscribe only for a transient send error */ + TRACE_DEVEL("error on send, subscribing", QMUX_EV_QCC_SEND, qcc->conn); + qcc->conn->xprt->subscribe(qcc->conn, qcc->conn->xprt_ctx, + SUB_RETRY_SEND, &qcc->wait_event); goto err; + } /* If there is frames left at this stage, transport layer is blocked. * Subscribe on it to retry later. diff --git a/src/quic_conn.c b/src/quic_conn.c index 1021bb130..4639e67a0 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -7809,7 +7809,8 @@ void qc_notify_close(struct quic_conn *qc) int qc_notify_send(struct quic_conn *qc) { if (qc->subs && qc->subs->events & SUB_RETRY_SEND) { - if (quic_path_prep_data(qc->path)) { + if (quic_path_prep_data(qc->path) && + (!qc_test_fd(qc) || !fd_send_active(qc->fd))) { tasklet_wakeup(qc->subs->tasklet); qc->subs->events &= ~SUB_RETRY_SEND; if (!qc->subs->events) diff --git a/src/quic_sock.c b/src/quic_sock.c index 8c99a76a6..fa2eb3d82 100644 --- a/src/quic_sock.c +++ b/src/quic_sock.c @@ -496,6 +496,7 @@ static void quic_conn_sock_fd_iocb(int fd) TRACE_DEVEL("send ready", QUIC_EV_CONN_RCV, qc); fd_stop_send(fd); tasklet_wakeup_after(NULL, qc->wait_event.tasklet); + qc_notify_send(qc); } if (fd_recv_ready(fd)) {