m) Fix: chop regen api may assert fail (#395)

packet's regen size MUST minus frame size which has been pad over
This commit is contained in:
wangfuyu 2022-07-19 20:37:28 +08:00 committed by GitHub
parent 9d60540faf
commit b46a5b19bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -540,6 +540,11 @@ lsquic_packet_out_pad_over (struct lsquic_packet_out *packet_out,
{
if ((1 << frec->fe_frame_type) & frame_types)
{
if ((1 << frec->fe_frame_type) & BQUIC_FRAME_REGEN_MASK)
{
packet_out->po_regen_sz -= frec->fe_len;
}
memset(packet_out->po_data + frec->fe_off, 0, frec->fe_len);
frec->fe_frame_type = QUIC_FRAME_PADDING;
}