# HG changeset patch # User Roman Arutyunyan # Date 1607530524 0 # Node ID 49efd27dace6cfd94040e87769e78940592f3fb6 # Parent 6201cef77b1d3671050d9db0f41300a18ab4e8b8 QUIC: use client max_ack_delay when computing pto timeout. Previously, server max_ack_delay was used which is wrong. Also, level check is simplified. diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -3423,10 +3423,8 @@ ngx_quic_pto(ngx_connection_t *c, ngx_qu return duration; } - if (ctx == &qc->send_ctx[2] && c->ssl->handshaked) { - /* application send space */ - - duration += qc->tp.max_ack_delay << qc->pto_count; + if (ctx->level == ssl_encryption_application && c->ssl->handshaked) { + duration += qc->ctp.max_ack_delay << qc->pto_count; } return duration;