MINOR: quic: Only one CRYPTO frame by encryption level
When receiving CRYPTO data from the TLS stack, concatenate the CRYPTO data
to the first allocated CRYPTO frame if present. This reduces by one the number
of handshake packets built for a connection with a standard size certificate.
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 4a0085f..ca21b1f 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -994,15 +994,21 @@
if (!len) {
struct quic_frame *frm;
- frm = pool_alloc(pool_head_quic_frame);
- if (!frm)
- return 0;
+ if (MT_LIST_ISEMPTY(&qel->pktns->tx.frms)) {
+ frm = pool_alloc(pool_head_quic_frame);
+ if (!frm)
+ return 0;
- frm->type = QUIC_FT_CRYPTO;
- frm->crypto.offset = cf_offset;
- frm->crypto.len = cf_len;
- frm->crypto.qel = qel;
- MT_LIST_APPEND(&qel->pktns->tx.frms, &frm->mt_list);
+ frm->type = QUIC_FT_CRYPTO;
+ frm->crypto.offset = cf_offset;
+ frm->crypto.len = cf_len;
+ frm->crypto.qel = qel;
+ MT_LIST_APPEND(&qel->pktns->tx.frms, &frm->mt_list);
+ }
+ else {
+ frm = MT_LIST_NEXT(&qel->pktns->tx.frms, struct quic_frame *, mt_list);
+ frm->crypto.len += cf_len;
+ }
}
return len == 0;