From 9dda9e51f374520ab5176bff72af38cf76632aea Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Tue, 24 Mar 2020 22:12:52 +0300 Subject: [PATCH] Advertise our max_idle_timeout in transport parameters. So we can easily tune how soon client would decide to close a connection. --- src/event/ngx_event_quic_transport.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/event/ngx_event_quic_transport.c b/src/event/ngx_event_quic_transport.c index e5d8f918c..b391f6b79 100644 --- a/src/event/ngx_event_quic_transport.c +++ b/src/event/ngx_event_quic_transport.c @@ -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;