aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2021-02-18 12:22:28 +0300
committerRoman Arutyunyan <arut@nginx.com>2021-02-18 12:22:28 +0300
commitedc2c75c75daaa3eb940efd9c5ce535826c8b090 (patch)
tree6212b98de7d90e40c6051fb0f06da4578186c623 /src
parente0425791d484b8e1e77cf39f6ca4da33b5c6e3a3 (diff)
downloadnginx-edc2c75c75daaa3eb940efd9c5ce535826c8b090.tar.gz
nginx-edc2c75c75daaa3eb940efd9c5ce535826c8b090.zip
QUIC: set idle timer when sending an ack-eliciting packet.
As per quic-transport-34: An endpoint also restarts its idle timer when sending an ack-eliciting packet if no other ack-eliciting packets have been sent since last receiving and processing a packet. Previously, the timer was set for any packet.
Diffstat (limited to 'src')
-rw-r--r--src/event/quic/ngx_event_quic.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/event/quic/ngx_event_quic.c b/src/event/quic/ngx_event_quic.c
index f99b0f854..0484909cf 100644
--- a/src/event/quic/ngx_event_quic.c
+++ b/src/event/quic/ngx_event_quic.c
@@ -4948,17 +4948,21 @@ static ngx_int_t
ngx_quic_output(ngx_connection_t *c)
{
off_t max;
- size_t len, min;
+ size_t len, min, in_flight;
ssize_t n;
u_char *p;
ngx_uint_t i, pad;
ngx_quic_send_ctx_t *ctx;
+ ngx_quic_congestion_t *cg;
ngx_quic_connection_t *qc;
static u_char dst[NGX_QUIC_MAX_UDP_PAYLOAD_SIZE];
c->log->action = "sending frames";
qc = ngx_quic_get_connection(c);
+ cg = &qc->congestion;
+
+ in_flight = cg->in_flight;
for ( ;; ) {
p = dst;
@@ -5003,11 +5007,11 @@ ngx_quic_output(ngx_connection_t *c)
if (n == NGX_ERROR) {
return NGX_ERROR;
}
+ }
- if (!qc->send_timer_set && !qc->closing) {
- qc->send_timer_set = 1;
- ngx_add_timer(c->read, qc->tp.max_idle_timeout);
- }
+ if (in_flight != cg->in_flight && !qc->send_timer_set && !qc->closing) {
+ qc->send_timer_set = 1;
+ ngx_add_timer(c->read, qc->tp.max_idle_timeout);
}
ngx_quic_set_lost_timer(c);