MINOR: quic: Prepare quic_frame struct duplication
We want to track the frames which have been duplicated during retransmissions so
that to avoid uselessly retransmitting frames which would already have been
acknowledged. ->origin new member is there to store the frame from which a copy
was done, ->reflist is a list to store the frames which are copies.
Also ensure all the frames are zeroed and that their ->reflist list member is
initialized.
Add QUIC_FL_TX_FRAME_ACKED flag definition to mark a TX frame as acknowledged.
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 05ca936..1ccabd9 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -1079,10 +1079,11 @@
found->crypto.len += cf_len;
}
else {
- frm = pool_alloc(pool_head_quic_frame);
+ frm = pool_zalloc(pool_head_quic_frame);
if (!frm)
return 0;
+ LIST_INIT(&frm->reflist);
frm->type = QUIC_FT_CRYPTO;
frm->crypto.offset = cf_offset;
frm->crypto.len = cf_len;
@@ -3141,6 +3142,7 @@
if (!frm)
return 0;
+ LIST_INIT(&frm->reflist);
frm->type = QUIC_FT_HANDSHAKE_DONE;
LIST_APPEND(&frm_list, &frm->list);
}
@@ -3154,6 +3156,7 @@
if (!frm)
goto err;
+ LIST_INIT(&frm->reflist);
cid = new_quic_cid(&qc->cids, qc, i);
if (!cid)
goto err;
@@ -5220,12 +5223,13 @@
else {
struct quic_frame *new_cf;
- new_cf = pool_alloc(pool_head_quic_frame);
+ new_cf = pool_zalloc(pool_head_quic_frame);
if (!new_cf) {
TRACE_PROTO("No memory for new crypto frame", QUIC_EV_CONN_BCFRMS, qc);
return 0;
}
+ LIST_INIT(&new_cf->reflist);
new_cf->type = QUIC_FT_CRYPTO;
new_cf->crypto.len = dlen;
new_cf->crypto.offset = cf->crypto.offset;
@@ -5301,6 +5305,7 @@
return 0;
}
+ LIST_INIT(&new_cf->reflist);
new_cf->type = cf->type;
new_cf->stream.stream = cf->stream.stream;
new_cf->stream.buf = cf->stream.buf;