haproxy/include/haproxy/quic_fctl.h
Amaury Denoyelle 25493ca036 MINOR: mux-quic: define a flow control related type
Create a new module dedicated to flow control handling. It will be used
to implement earlier flow control update on snd_buf stream callback.

For the moment, only Tx part is implemented (i.e. limit set by the peer
that haproxy must respect for sending). A type quic_fctl is defined to
count emitted data bytes. Two offsets are used : a real one and a soft
one. The difference is that soft offset can be incremented beyond limit
unless it is already in excess.

Soft offset will be used for HTX to H3 parsing. As size of generated H3
is unknown before parsing, it allows to surpass the limit one time. Real
offset will be used during STREAM frame generation : this time the limit
must not be exceeded to prevent protocol violation.
2024-01-31 16:28:54 +01:00

20 lines
563 B
C

#ifndef _HAPROXY_QUIC_FCTL_H
#define _HAPROXY_QUIC_FCTL_H
#include <haproxy/quic_fctl-t.h>
void qfctl_init(struct quic_fctl *fctl, uint64_t limit);
int qfctl_rblocked(const struct quic_fctl *fctl);
int qfctl_sblocked(const struct quic_fctl *fctl);
int qfctl_set_max(struct quic_fctl *fctl, uint64_t val,
int *unblock_soft, int *unblock_real);
int qfctl_rinc(struct quic_fctl *fctl, uint64_t diff);
int qfctl_sinc(struct quic_fctl *fctl, uint64_t diff);
uint64_t qfctl_rcap(const struct quic_fctl *fctl);
#endif /* _HAPROXY_QUIC_FCTL_H */