mirror of
https://github.com/nginx/nginx.git
synced 2026-10-25 13:32:27 +00:00
QUIC: fixed padding calculation.
Sometimes, QUIC packets need to be of certain (or minimal) size. This is achieved by adding PADDING frames. It is possible, that adding padding will affect header size, thus forcing us to recalculate padding size once more.
This commit is contained in:
parent
a85084fea1
commit
1860eda336
1 changed files with 3 additions and 0 deletions
|
|
@ -368,6 +368,9 @@ ngx_quic_output_packet(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx,
|
|||
}
|
||||
|
||||
if (out.len < pad_len) {
|
||||
/* compensate for potentially enlarged header in Length bytes */
|
||||
pad_len -= ngx_quic_create_header(&pkt, NULL, pad_len, NULL)
|
||||
- ngx_quic_create_header(&pkt, NULL, out.len, NULL);
|
||||
ngx_memset(p, NGX_QUIC_FT_PADDING, pad_len - out.len);
|
||||
out.len = pad_len;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue