MINOR: quic: support a max number of built packet per send iteration
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 11 Oct 2024 15:57:57 +0000 (17:57 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 19 Nov 2024 15:16:48 +0000 (16:16 +0100)
commit5cb8f8a6224db96f4386277c41ddae4a29a4130d
tree886efbe77a56ac991b06b85e3e86e82f26754a1d
parenta554d82131dde3fd0d5e0bc110814cf6feb98338
MINOR: quic: support a max number of built packet per send iteration

Extend QUIC transport emission function to support a maximum datagram
argument. The purpose is to ensure that qc_send() won't emit more than
the specified value, unless it is 0 which is considered as unlimited.

In qc_prep_pkts(), a counter of built datagram has been added to support
this. The packet building loop is interrupted if it reaches a specified
maximum value. Also, its return value has been changed to the number of
prepared datagrams. This is reused by qc_send() to interrupt its work if
a specified max datagram argument value is reached over one or several
iteration of prepared/sent datagrams.

This change is necessary to support pacing emission. Note that ideally,
the total length in bytes of emitted datagrams should be taken into
account instead of the raw number of datagrams. However, for a first
implementation, it was deemed easier to implement it with the latter.
include/haproxy/quic_tx.h
src/quic_conn.c
src/quic_tx.c