mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
QUIC: fixed PATH_RESPONSE frame expansion.
The PATH_RESPONSE frame must be expanded to 1200, except the case when anti-amplification limit is in effect, i.e. on unvalidated paths. Previously, the anti-amplification limit was always applied.
This commit is contained in:
parent
62b2eea0fe
commit
1562200066
@ -47,12 +47,20 @@ ngx_quic_handle_path_challenge_frame(ngx_connection_t *c,
|
|||||||
path = qsock->path;
|
path = qsock->path;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* An endpoint MUST expand datagrams that contain a PATH_RESPONSE frame
|
||||||
|
* to at least the smallest allowed maximum datagram size of 1200 bytes.
|
||||||
|
* ...
|
||||||
* An endpoint MUST NOT expand the datagram containing the PATH_RESPONSE
|
* An endpoint MUST NOT expand the datagram containing the PATH_RESPONSE
|
||||||
* if the resulting data exceeds the anti-amplification limit.
|
* if the resulting data exceeds the anti-amplification limit.
|
||||||
*/
|
*/
|
||||||
max = path->received * 3;
|
if (path->state != NGX_QUIC_PATH_VALIDATED) {
|
||||||
max = (path->sent >= max) ? 0 : max - path->sent;
|
max = path->received * 3;
|
||||||
pad = ngx_min(1200, max);
|
max = (path->sent >= max) ? 0 : max - path->sent;
|
||||||
|
pad = ngx_min(1200, max);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
pad = 1200;
|
||||||
|
}
|
||||||
|
|
||||||
sent = ngx_quic_frame_sendto(c, &frame, pad, path->sockaddr, path->socklen);
|
sent = ngx_quic_frame_sendto(c, &frame, pad, path->sockaddr, path->socklen);
|
||||||
if (sent < 0) {
|
if (sent < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user