From 33dca887925d9cec7153252dcd5380c394090936 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 13 Sep 2023 17:59:37 +0400 Subject: QUIC: "handshake_timeout" configuration parameter. Previously QUIC did not have such parameter and handshake duration was controlled by HTTP/3. However that required creating and storing HTTP/3 session on first client datagram. Apparently there's no convenient way to store the session object until QUIC handshake is complete. In the followup patches session creation will be postponed to init() callback. --- src/event/quic/ngx_event_quic.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/event/quic/ngx_event_quic.c') diff --git a/src/event/quic/ngx_event_quic.c b/src/event/quic/ngx_event_quic.c index 6852bb070..0032a5505 100644 --- a/src/event/quic/ngx_event_quic.c +++ b/src/event/quic/ngx_event_quic.c @@ -211,6 +211,8 @@ ngx_quic_run(ngx_connection_t *c, ngx_quic_conf_t *conf) qc = ngx_quic_get_connection(c); ngx_add_timer(c->read, qc->tp.max_idle_timeout); + ngx_add_timer(&qc->close, qc->conf->handshake_timeout); + ngx_quic_connstate_dbg(c); c->read->handler = ngx_quic_input_handler; @@ -485,6 +487,10 @@ ngx_quic_close_connection(ngx_connection_t *c, ngx_int_t rc) ngx_quic_free_frames(c, &qc->send_ctx[i].sent); } + if (qc->close.timer_set) { + ngx_del_timer(&qc->close); + } + if (rc == NGX_DONE) { /* -- cgit