MINOR: quic: old data distinction for qc_send_app_pkt()
Modify qc_send_app_pkt() to distinguish the case where it sends new data
against the case where it sends old data during probing retransmissions.
We add <old_data> boolean parameter to this function to do so. The mux
never directly send old data when probing retransmissions are needed by
the connection.
diff --git a/include/haproxy/xprt_quic.h b/include/haproxy/xprt_quic.h
index 1a2a3ce..8fb24e3 100644
--- a/include/haproxy/xprt_quic.h
+++ b/include/haproxy/xprt_quic.h
@@ -1246,7 +1246,7 @@
int quic_lstnr_dgram_dispatch(unsigned char *buf, size_t len, void *owner,
struct sockaddr_storage *saddr,
struct quic_dgram *new_dgram, struct list *dgrams);
-int qc_send_app_pkts(struct quic_conn *qc, struct list *frms);
+int qc_send_app_pkts(struct quic_conn *qc, int old_data, struct list *frms);
void qc_notify_close(struct quic_conn *qc);
diff --git a/src/mux_quic.c b/src/mux_quic.c
index edf2be8..2e5ebdc 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -799,7 +799,7 @@
}
if (!LIST_ISEMPTY(frms))
- qc_send_app_pkts(qcc->conn->handle.qc, frms);
+ qc_send_app_pkts(qcc->conn->handle.qc, 0, frms);
/* If there is frames left, check if the transport layer has send some
* data or is blocked.
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 615c4ff..d688f20 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -3763,7 +3763,7 @@
}
/* Sends application level packets from <qc> QUIC connection */
-int qc_send_app_pkts(struct quic_conn *qc, struct list *frms)
+int qc_send_app_pkts(struct quic_conn *qc, int old_data, struct list *frms)
{
int ret;
struct qring *qr;
@@ -3773,6 +3773,8 @@
/* Never happens */
return 1;
+ if (old_data)
+ qc->flags |= QUIC_FL_CONN_RETRANS_OLD_DATA;
ret = qc_prep_app_pkts(qc, qr, frms);
if (ret == -1)
goto err;
@@ -3783,10 +3785,12 @@
goto err;
out:
+ qc->flags &= ~QUIC_FL_CONN_RETRANS_OLD_DATA;
MT_LIST_APPEND(qc->tx.qring_list, &qr->mt_list);
return 1;
err:
+ qc->flags &= ~QUIC_FL_CONN_RETRANS_OLD_DATA;
MT_LIST_APPEND(qc->tx.qring_list, &qr->mt_list);
TRACE_DEVEL("leaving in error", QUIC_EV_CONN_IO_CB, qc);
return 0;
@@ -3926,7 +3930,7 @@
!(qc->flags & QUIC_FL_CONN_IMMEDIATE_CLOSE))
goto out;
- if (!qc_send_app_pkts(qc, &qel->pktns->tx.frms))
+ if (!qc_send_app_pkts(qc, 0, &qel->pktns->tx.frms))
goto err;
out: