1#ifndef CWIST_NET_QUIC_FLOW_CONTROL_H
2#define CWIST_NET_QUIC_FLOW_CONTROL_H
8#define QUIC_FLOW_CONTROL_MIN_INITIAL_WINDOW (1024ULL * 1024ULL)
48 uint64_t initial_stream_window, uint64_t max_conn_window,
49 uint64_t max_stream_window);
64 size_t *written,
bool force);
67 uint8_t *buf,
size_t buf_len,
size_t *written,
void quic_flow_control_consume_conn(quic_conn_fc_t *fc, uint64_t bytes)
Account for connection-level flow control bytes consumed by the peer.
void quic_flow_control_update_rtt(quic_conn_fc_t *fc, uint64_t rtt_sample_us)
Feed an RTT sample into the smoothed RTT estimator and re-evaluate quality.
void quic_flow_control_init(quic_conn_fc_t *fc, uint64_t initial_conn_window, uint64_t initial_stream_window, uint64_t max_conn_window, uint64_t max_stream_window)
Initialize the connection-level flow control state.
int quic_flow_control_maybe_send_max_stream_data(quic_conn_fc_t *fc, quic_stream_fc_t *sfc, uint8_t *buf, size_t buf_len, size_t *written, bool force)
Write a MAX_STREAM_DATA frame if the stream limit should be raised.
struct quic_conn_fc quic_conn_fc_t
@ QUIC_NET_QUALITY_NORMAL
@ QUIC_NET_QUALITY_HIGH_RTT
@ QUIC_NET_QUALITY_EXCELLENT
quic_net_quality_t quic_flow_control_evaluate_quality(quic_conn_fc_t *fc)
Recompute the network quality class from the smoothed RTT.
int quic_flow_control_maybe_send_max_data(quic_conn_fc_t *fc, uint8_t *buf, size_t buf_len, size_t *written, bool force)
Write a MAX_DATA frame if the connection limit should be raised.
void quic_flow_control_consume_stream(quic_conn_fc_t *fc, quic_stream_fc_t *sfc, uint64_t bytes)
Account for stream-level flow control bytes consumed by the peer.
struct quic_stream_fc quic_stream_fc_t
void quic_stream_fc_init(quic_stream_fc_t *sfc, uint64_t stream_id, uint64_t initial_stream_window)
Initialize the flow control state for a single stream.
void quic_flow_control_adjust_windows(quic_conn_fc_t *fc, quic_stream_fc_t *sfc)
Grow flow control windows when the network quality is degraded.
uint64_t base_stream_window
uint64_t stream_max_window
uint64_t conn_window_size
quic_net_quality_t quality
uint64_t stream_min_window
uint64_t stream_window_size