diff src/event/ngx_event_quic_protection.c @ 7847:262396242352 quic

Reworked macros for parsing/assembling packet types. Previously, macros checking a packet type with the long header also checked whether this is a long header. Now it requires a separate preceding check.
author Vladimir Homutov <vl@nginx.com>
date Thu, 30 Apr 2020 12:38:38 +0300
parents f175006124d0
children 0aa6b02a1546
line wrap: on
line diff
--- a/src/event/ngx_event_quic_protection.c
+++ b/src/event/ngx_event_quic_protection.c
@@ -948,7 +948,7 @@ ssize_t
 ngx_quic_encrypt(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
     ngx_str_t *res)
 {
-    if (pkt->level == ssl_encryption_application) {
+    if (ngx_quic_short_pkt(pkt->flags)) {
         return ngx_quic_create_short_packet(pkt, ssl_conn, res);
     }