Mercurial > hg > nginx
comparison src/event/ngx_event_quic.c @ 8641:fe53def49945 quic
QUIC: refactored long header parsing.
The largely duplicate type-specific functions ngx_quic_parse_initial_header(),
ngx_quic_parse_handshake_header(), and a missing one for 0-RTT, were merged.
The new order of functions listed in ngx_event_quic_transport.c reflects this.
|_ ngx_quic_parse_long_header - version-invariant long header fields
\_ ngx_quic_supported_version - a helper to decide we can go further
\_ ngx_quic_parse_long_header_v1 - QUICv1-specific long header fields
0-RTT packets previously appeared as Handshake are now logged as appropriate:
*1 quic packet rx long flags:db version:ff00001d
*1 quic packet rx early len:870
Logging SCID/DCID is no longer duplicated as were seen with Initial packets.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 17 Nov 2020 21:32:04 +0000 |
parents | 9d28e9028aa5 |
children | 05b1ee464350 |
comparison
equal
deleted
inserted
replaced
8640:46374c3fee3f | 8641:fe53def49945 |
---|---|
44 | 44 |
45 #define NGX_QUIC_MIN_SR_PACKET 43 /* 5 random + 16 srt + 22 padding */ | 45 #define NGX_QUIC_MIN_SR_PACKET 43 /* 5 random + 16 srt + 22 padding */ |
46 #define NGX_QUIC_MAX_SR_PACKET 1200 | 46 #define NGX_QUIC_MAX_SR_PACKET 1200 |
47 | 47 |
48 #define NGX_QUIC_MAX_ACK_GAP 2 | 48 #define NGX_QUIC_MAX_ACK_GAP 2 |
49 | |
50 #define ngx_quic_level_name(lvl) \ | |
51 (lvl == ssl_encryption_application) ? "app" \ | |
52 : (lvl == ssl_encryption_initial) ? "init" \ | |
53 : (lvl == ssl_encryption_handshake) ? "hs" : "early" | |
54 | 49 |
55 | 50 |
56 typedef struct { | 51 typedef struct { |
57 ngx_rbtree_t tree; | 52 ngx_rbtree_t tree; |
58 ngx_rbtree_node_t sentinel; | 53 ngx_rbtree_node_t sentinel; |
2084 | 2079 |
2085 if (pkt->level != ssl_encryption_application) { | 2080 if (pkt->level != ssl_encryption_application) { |
2086 ngx_quic_hexdump(c->log, "quic packet rx scid", pkt->scid.data, | 2081 ngx_quic_hexdump(c->log, "quic packet rx scid", pkt->scid.data, |
2087 pkt->scid.len); | 2082 pkt->scid.len); |
2088 } | 2083 } |
2084 | |
2085 if (pkt->level == ssl_encryption_initial) { | |
2086 ngx_quic_hexdump(c->log, "quic token", pkt->token.data, pkt->token.len); | |
2087 } | |
2089 #endif | 2088 #endif |
2090 | 2089 |
2091 if (qc) { | 2090 if (qc) { |
2092 | 2091 |
2093 if (rc == NGX_ABORT) { | 2092 if (rc == NGX_ABORT) { |