CLEANUP: quic: Remove cdata_len from quic_tx_packet struct
This field is no more useful. Modify the traces consequently.
Also initialize ->pn_node.key value to -1, which is an illegal value
for QUIC packet number, and display it in traces if different from -1.
diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h
index dbca9da..e3ded39 100644
--- a/include/haproxy/xprt_quic-t.h
+++ b/include/haproxy/xprt_quic-t.h
@@ -500,8 +500,6 @@
*/
size_t in_flight_len;
struct eb64_node pn_node;
- /* The number of bytes of CRYPTO data in this packet. */
- unsigned int cdata_len;
/* The list of frames of this packet. */
struct list frms;
/* The time this packet was sent (usec). */
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 54112f1..08c4ad1 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -335,8 +335,8 @@
}
if (pkt) {
const struct quic_frame *frm;
- chunk_appendf(&trace_buf, " pn=%llu cdlen=%u",
- (unsigned long long)pkt->pn_node.key, pkt->cdata_len);
+ if (pkt->pn_node.key != (uint64_t)-1)
+ chunk_appendf(&trace_buf, " pn=%llu",(ull)pkt->pn_node.key);
list_for_each_entry(frm, &pkt->frms, list)
chunk_tx_frm_appendf(&trace_buf, frm);
chunk_appendf(&trace_buf, " tx.bytes=%llu", (unsigned long long)qc->tx.bytes);
@@ -564,12 +564,11 @@
(unsigned long long)qc->path->prep_in_flight,
(unsigned long long)qc->path->in_flight);
if (pkt) {
- chunk_appendf(&trace_buf, " pn=%lu(%s) iflen=%llu cdlen=%llu",
+ chunk_appendf(&trace_buf, " pn=%lu(%s) iflen=%llu",
(unsigned long)pkt->pn_node.key,
pkt->pktns == &qc->pktns[QUIC_TLS_PKTNS_INITIAL] ? "I" :
pkt->pktns == &qc->pktns[QUIC_TLS_PKTNS_01RTT] ? "01RTT": "H",
- (unsigned long long)pkt->in_flight_len,
- (unsigned long long)pkt->cdata_len);
+ (unsigned long long)pkt->in_flight_len);
}
}
@@ -4334,7 +4333,6 @@
if (!dlen)
break;
- pkt->cdata_len += dlen;
/* CRYPTO frame length. */
flen = hlen + quic_int_getsize(dlen) + dlen;
TRACE_PROTO(" CRYPTO frame length (flen)",
@@ -4666,8 +4664,8 @@
{
pkt->type = type;
pkt->len = 0;
- pkt->cdata_len = 0;
pkt->in_flight_len = 0;
+ pkt->pn_node.key = (uint64_t)-1;
LIST_INIT(&pkt->frms);
pkt->next = NULL;
pkt->refcnt = 1;