MINOR: quic: implement function to check if STREAM is fully acked
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 6 Aug 2024 15:36:56 +0000 (17:36 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 19 Sep 2024 08:54:02 +0000 (10:54 +0200)
commitaf8d1c24e58e2e5a8d5ba2b960fbdf240855068f
treeb8ca920b764fb55c5f5ccab429fa029bf65191b0
parentcbdf1ecb1951d29d97d70b6b9daa0278fcedd261
MINOR: quic: implement function to check if STREAM is fully acked

When a STREAM frame is retransmitted, a check is performed to remove
range of data already acked from it. This is useful when STREAM frames
are duplicated and splitted to cover different data ranges. The newly
retransmitted frame contains only unacked data.

This process is performed similarly in qc_dup_pkt_frms() and
qc_build_frms(). Refactor the code into a new function named
qc_stream_frm_is_acked(). It returns true if frame data are already
fully acked and retransmission can be avoided. If only a partial range
of data is acknowledged, frame content is updated to only cover the
unacked data.

This patch does not have any functional change. However, it simplifies
retransmission for STREAM frames. Also, it will be reused to fix
retransmission for empty STREAM frames with FIN set from the following
patch :
  BUG/MEDIUM: quic: handle retransmit for standalone FIN STREAM

As such, it must be backported prior to it.

(cherry picked from commit 714009b7bcf921836c2df7fc0d26b2ad257c8307)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/quic_retransmit.h
src/quic_retransmit.c
src/quic_rx.c
src/quic_tx.c