Advertise our max_idle_timeout in transport parameters.

So we can easily tune how soon client would decide to close a connection.
This commit is contained in:
Sergey Kandaurov 2020-03-24 22:12:52 +03:00
parent c87e5a3a13
commit 9dda9e51f3

View file

@ -1573,6 +1573,9 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp)
len += ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI,
tp->initial_max_stream_data_uni);
len += ngx_quic_tp_len(NGX_QUIC_TP_MAX_IDLE_TIMEOUT,
tp->max_idle_timeout);
if (pos == NULL) {
#if (NGX_QUIC_DRAFT_VERSION < 27)
len += 2;
@ -1606,6 +1609,9 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp)
ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI,
tp->initial_max_stream_data_uni);
ngx_quic_tp_vint(NGX_QUIC_TP_MAX_IDLE_TIMEOUT,
tp->max_idle_timeout);
ngx_quic_hexdump0(ngx_cycle->log, "transport parameters", pos, p - pos);
return p - pos;