]> git.kaiwu.me - nginx.git/commitdiff
QUIC: simplified ngx_quic_create_long_header().
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 21 Oct 2020 11:03:22 +0000 (12:03 +0100)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 21 Oct 2020 11:03:22 +0000 (12:03 +0100)
As seen in the quic-transport draft, which this implementation follows:
Initial packets sent by the server MUST set the Token Length field to zero.

src/event/ngx_event_quic_transport.c

index 1bd470f2610aae927f3931bfec6280a4e6a55902..cea69ab7ae87f23efd1d553c205b4de0d92ca3ac 100644 (file)
@@ -433,7 +433,7 @@ ngx_quic_create_long_header(ngx_quic_header_t *pkt, u_char *out,
     p = ngx_cpymem(p, pkt->scid.data, pkt->scid.len);
 
     if (pkt->level == ssl_encryption_initial) {
-        ngx_quic_build_int(&p, pkt->token.len);
+        ngx_quic_build_int(&p, 0);
     }
 
     ngx_quic_build_int(&p, pkt_len + pkt->num_len);