diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2022-02-02 15:57:08 +0300 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2022-02-02 15:57:08 +0300 |
commit | 8a61c89a276ae5626ff84f6dd1e9da218754a313 (patch) | |
tree | 98c8adf66fcd4029d69664114a4c6cd8af6f0a24 | |
parent | 3b4d10caf6eb3cb7b86c1b6064869b935a7d0076 (diff) | |
download | nginx-8a61c89a276ae5626ff84f6dd1e9da218754a313.tar.gz nginx-8a61c89a276ae5626ff84f6dd1e9da218754a313.zip |
QUIC: do not arm loss detection timer if nothing was sent.
Notably, this became quite practicable after the recent fix in cd8018bc81a5.
Additionally, do not arm loss detection timer on connection termination.
-rw-r--r-- | src/event/quic/ngx_event_quic_output.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/event/quic/ngx_event_quic_output.c b/src/event/quic/ngx_event_quic_output.c index 103dd0e5c..ebfe0cfc2 100644 --- a/src/event/quic/ngx_event_quic_output.c +++ b/src/event/quic/ngx_event_quic_output.c @@ -104,7 +104,12 @@ ngx_quic_output(ngx_connection_t *c) return NGX_ERROR; } - if (in_flight != cg->in_flight && !qc->send_timer_set && !qc->closing) { + if (in_flight == cg->in_flight || qc->closing) { + /* no ack-eliciting data was sent or we are done */ + return NGX_OK; + } + + if (!qc->send_timer_set) { qc->send_timer_set = 1; ngx_add_timer(c->read, qc->tp.max_idle_timeout); } |