]> git.kaiwu.me - nginx.git/commitdiff
Advertise our max_idle_timeout in transport parameters.
authorSergey Kandaurov <pluknet@nginx.com>
Tue, 24 Mar 2020 19:12:52 +0000 (22:12 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Tue, 24 Mar 2020 19:12:52 +0000 (22:12 +0300)
So we can easily tune how soon client would decide to close a connection.

src/event/ngx_event_quic_transport.c

index e5d8f918c3fad0a7994b6c7e88e1b94972d55f5e..b391f6b79ed143b9eb9abd349c84f6f1602c50ad 100644 (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;