mirror of
https://github.com/nginx/nginx.git
synced 2024-12-12 02:09:04 +08:00
QUIC: update packet length for short packets too.
During long packet header parsing, pkt->len is updated with the Length field value that is used to find next coalesced packets in a datagram. For short packets it still contained the whole QUIC packet size. This change uniforms packet length handling to always contain the total length of the packet number and protected packet payload in pkt->len.
This commit is contained in:
parent
e43ef3dda9
commit
952c6f1989
@ -1058,13 +1058,12 @@ ngx_quic_decrypt(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
|
||||
/* packet protection */
|
||||
|
||||
in.data = p;
|
||||
in.len = pkt->len - pnl;
|
||||
|
||||
if (ngx_quic_long_pkt(pkt->flags)) {
|
||||
in.len = pkt->len - pnl;
|
||||
badflags = clearflags & NGX_QUIC_PKT_LONG_RESERVED_BIT;
|
||||
|
||||
} else {
|
||||
in.len = pkt->data + pkt->len - p;
|
||||
badflags = clearflags & NGX_QUIC_PKT_SHORT_RESERVED_BIT;
|
||||
}
|
||||
|
||||
|
@ -511,6 +511,7 @@ ngx_quic_parse_short_header(ngx_quic_header_t *pkt, ngx_str_t *dcid)
|
||||
}
|
||||
|
||||
pkt->raw->pos = p;
|
||||
pkt->len = end - p;
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user