]> git.kaiwu.me - nginx.git/commit
QUIC: fixed close timer processing with early data.
authorVladimir Khomutov <vl@wbsrv.ru>
Wed, 10 Apr 2024 06:38:10 +0000 (09:38 +0300)
committerVladimir Khomutov <vl@wbsrv.ru>
Wed, 10 Apr 2024 06:38:10 +0000 (09:38 +0300)
commit92f99685717e857de9ffa96993601a90803eb0d8
treec0091d8a88b05a6c1dae8f035328100ff6af3ef3
parente3207a17f084c9eb7905ca0f2cfdb1df088fd165
QUIC: fixed close timer processing with early data.

The ngx_quic_run() function uses qc->close timer to limit the handshake
duration.  Normally it is removed by ngx_quic_do_init_streams() which is
called once when we are done with initial SSL processing.

The problem happens when the client sends early data and streams are
initialized in the ngx_quic_run() -> ngx_quic_handle_datagram() call.
The order of set/remove timer calls is now reversed; the close timer is
set up and the timer fires when assigned, starting the unexpected connection
close process.

The fix is to skip setting the timer if streams were initialized during
handling of the initial datagram.  The idle timer for quic is set anyway,
and stream-related timeouts are managed by application layer.
src/event/quic/ngx_event_quic.c