mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-04-21 14:21:31 +02:00
BUG/MINOR: quic: do not use hardcoded values in QMux TP frame builder
Reuse QUIC transport parameters value set in xprt_qstrm layer in frame builder function. Prior to this patch, mux_quic would use different values from the advertised ones. No need to backport.
This commit is contained in:
parent
073240044e
commit
34c9ded340
@ -1017,6 +1017,7 @@ static int quic_build_handshake_done_frame(unsigned char **pos, const unsigned c
|
||||
static int quic_build_qmux_transport_parameters(unsigned char **pos, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct qf_qx_transport_parameters *params_frm = &frm->qmux_transport_params;
|
||||
unsigned char *old = *pos;
|
||||
struct buffer buf;
|
||||
|
||||
@ -1030,19 +1031,19 @@ static int quic_build_qmux_transport_parameters(unsigned char **pos, const unsig
|
||||
return 0;
|
||||
*pos += 8;
|
||||
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_MAX_IDLE_TIMEOUT, 30000))
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_MAX_IDLE_TIMEOUT, params_frm->params.max_idle_timeout))
|
||||
return 0;
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_DATA, 16384))
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_DATA, params_frm->params.initial_max_data))
|
||||
return 0;
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, 16384))
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, params_frm->params.initial_max_stream_data_bidi_local))
|
||||
return 0;
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, 16384))
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, params_frm->params.initial_max_stream_data_bidi_remote))
|
||||
return 0;
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI, 16384))
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI, params_frm->params.initial_max_stream_data_uni))
|
||||
return 0;
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAMS_BIDI, 100))
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAMS_BIDI, params_frm->params.initial_max_streams_bidi))
|
||||
return 0;
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAMS_UNI, 100))
|
||||
if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAMS_UNI, params_frm->params.initial_max_streams_uni))
|
||||
return 0;
|
||||
|
||||
/* Re-encode the real length field now. */
|
||||
|
||||
@ -268,6 +268,8 @@ static int xprt_qstrm_init(struct connection *conn, void **xprt_ctx)
|
||||
memset(&ctx->rparams, 0, sizeof(struct quic_transport_params));
|
||||
|
||||
/* TP configuration advertised by us */
|
||||
ctx->lparams.max_idle_timeout = 30;
|
||||
ctx->lparams.initial_max_data = 1638400;
|
||||
ctx->lparams.initial_max_streams_bidi = 100;
|
||||
ctx->lparams.initial_max_streams_uni = 3;
|
||||
ctx->lparams.initial_max_stream_data_bidi_local = qmux_stream_rx_bufsz();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user