Mercurial > hg > nginx
diff src/event/quic/ngx_event_quic_output.c @ 8940:fb41e37ddeb0 quic
QUIC: decoupled path state and limitation status.
The path validation status and anti-amplification limit status is actually
two different variables. It is possible that validating path should not
be limited (for example, when re-validating former path).
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Mon, 13 Dec 2021 09:48:33 +0300 |
parents | 501f28679d56 |
children | 0433e69f5425 |
line wrap: on
line diff
--- a/src/event/quic/ngx_event_quic_output.c +++ b/src/event/quic/ngx_event_quic_output.c @@ -160,7 +160,7 @@ ngx_quic_create_datagrams(ngx_connection len = ngx_min(qc->ctp.max_udp_payload_size, NGX_QUIC_MAX_UDP_PAYLOAD_SIZE); - if (path->state != NGX_QUIC_PATH_VALIDATED) { + if (path->limited) { max = path->received * 3; max = (path->sent >= max) ? 0 : max - path->sent; @@ -294,7 +294,7 @@ ngx_quic_allow_segmentation(ngx_connecti return 0; } - if (qsock->path->state != NGX_QUIC_PATH_VALIDATED) { + if (qsock->path->limited) { /* don't even try to be faster on non-validated paths */ return 0; } @@ -1229,7 +1229,7 @@ ngx_quic_frame_sendto(ngx_connection_t * ngx_quic_init_packet(c, ctx, qc->socket, &pkt); /* account for anti-amplification limit: expand to allowed size */ - if (path->state != NGX_QUIC_PATH_VALIDATED) { + if (path->limited) { max = path->received * 3; max = (path->sent >= max) ? 0 : max - path->sent; if ((off_t) min > max) {