mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-18 01:14:38 +00:00
BUG/MINOR: mux-quic: properly initialize flow control
Initialize all flow control members on the qcc instance. Without this, the value are undefined and it may be possible to have errors about reached streams limit.
This commit is contained in:
parent
5154e7a252
commit
f3b0ba7dc9
@ -42,6 +42,9 @@ struct qcc {
|
||||
} tx;
|
||||
} strms[QCS_MAX_TYPES];
|
||||
|
||||
struct {
|
||||
uint64_t max_data; /* Maximum number of bytes which may be received */
|
||||
} rx;
|
||||
struct {
|
||||
uint64_t max_data; /* Maximum number of bytes which may be sent */
|
||||
} tx;
|
||||
|
@ -312,6 +312,7 @@ static int qc_init(struct connection *conn, struct proxy *prx,
|
||||
struct session *sess, struct buffer *input)
|
||||
{
|
||||
struct qcc *qcc;
|
||||
struct quic_transport_params *srv_params;
|
||||
|
||||
qcc = pool_alloc(pool_head_qcc);
|
||||
if (!qcc)
|
||||
@ -325,14 +326,37 @@ static int qc_init(struct connection *conn, struct proxy *prx,
|
||||
|
||||
qcc->streams_by_id = EB_ROOT_UNIQUE;
|
||||
|
||||
/* Server parameters, params used for RX flow control. */
|
||||
srv_params = &conn->qc->rx.params;
|
||||
|
||||
qcc->rx.max_data = srv_params->initial_max_data;
|
||||
qcc->tx.max_data = 0;
|
||||
|
||||
/* Client initiated streams must respect the server flow control. */
|
||||
qcc->strms[QCS_CLT_BIDI].max_streams = srv_params->initial_max_streams_bidi;
|
||||
qcc->strms[QCS_CLT_BIDI].nb_streams = 0;
|
||||
qcc->strms[QCS_CLT_BIDI].largest_id = -1;
|
||||
qcc->strms[QCS_CLT_BIDI].rx.max_data = 0;
|
||||
qcc->strms[QCS_CLT_BIDI].tx.max_data = srv_params->initial_max_stream_data_bidi_remote;
|
||||
|
||||
qcc->strms[QCS_CLT_UNI].max_streams = srv_params->initial_max_streams_uni;
|
||||
qcc->strms[QCS_CLT_UNI].nb_streams = 0;
|
||||
qcc->strms[QCS_CLT_UNI].largest_id = -1;
|
||||
qcc->strms[QCS_CLT_UNI].rx.max_data = 0;
|
||||
qcc->strms[QCS_CLT_UNI].tx.max_data = srv_params->initial_max_stream_data_uni;
|
||||
|
||||
/* Server initiated streams must respect the server flow control. */
|
||||
qcc->strms[QCS_SRV_BIDI].max_streams = 0;
|
||||
qcc->strms[QCS_SRV_BIDI].nb_streams = 0;
|
||||
qcc->strms[QCS_SRV_BIDI].largest_id = -1;
|
||||
qcc->strms[QCS_SRV_BIDI].rx.max_data = srv_params->initial_max_stream_data_bidi_local;
|
||||
qcc->strms[QCS_SRV_BIDI].tx.max_data = 0;
|
||||
|
||||
qcc->strms[QCS_SRV_UNI].max_streams = 0;
|
||||
qcc->strms[QCS_SRV_UNI].nb_streams = 0;
|
||||
qcc->strms[QCS_SRV_UNI].largest_id = -1;
|
||||
qcc->strms[QCS_SRV_UNI].rx.max_data = srv_params->initial_max_stream_data_uni;
|
||||
qcc->strms[QCS_SRV_UNI].tx.max_data = 0;
|
||||
|
||||
qcc->wait_event.tasklet = tasklet_new();
|
||||
if (!qcc->wait_event.tasklet)
|
||||
|
Loading…
Reference in New Issue
Block a user