mirror of
https://github.com/nginx/nginx.git
synced 2025-06-22 13:51:12 +08:00
QUIC: fixed handling of incorrect packets.
Instead of ignoring, connection was closed. This was broken in d0d3fc0697a0.
This commit is contained in:
parent
88cb4d3ab0
commit
a06a3f6aba
@ -256,7 +256,12 @@ ngx_quic_parse_packet(ngx_quic_header_t *pkt)
|
||||
if (!ngx_quic_long_pkt(pkt->flags)) {
|
||||
pkt->level = ssl_encryption_application;
|
||||
|
||||
return ngx_quic_parse_short_header(pkt, NGX_QUIC_SERVER_CID_LEN);
|
||||
if (ngx_quic_parse_short_header(pkt, NGX_QUIC_SERVER_CID_LEN) != NGX_OK)
|
||||
{
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
if (ngx_quic_parse_long_header(pkt) != NGX_OK) {
|
||||
@ -277,7 +282,11 @@ ngx_quic_parse_packet(ngx_quic_header_t *pkt)
|
||||
|
||||
pkt->level = ssl_encryption_initial;
|
||||
|
||||
return ngx_quic_parse_initial_header(pkt);
|
||||
if (ngx_quic_parse_initial_header(pkt) != NGX_OK) {
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
if (ngx_quic_pkt_hs(pkt->flags)) {
|
||||
@ -292,7 +301,11 @@ ngx_quic_parse_packet(ngx_quic_header_t *pkt)
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
return ngx_quic_parse_handshake_header(pkt);
|
||||
if (ngx_quic_parse_handshake_header(pkt) != NGX_OK) {
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user