Mercurial > hg > nginx-quic
annotate src/event/ngx_event_quic.h @ 7994:f9fbeb4ee0de quic
QUIC: added limit of queued data.
The ngx_quic_queue_frame() functions puts a frame into send queue and
schedules a push timer to actually send data.
The patch adds tracking for data amount in the queue and sends data
immediately if amount of data exceeds limit.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Thu, 16 Jul 2020 15:02:38 +0300 |
parents | b276833111cf |
children | f537f99b86ee |
rev | line source |
---|---|
7633
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
1 |
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
2 /* |
7648
b28ea685a56e
Moved all QUIC code into ngx_event_quic.c
Vladimir Homutov <vl@nginx.com>
parents:
7647
diff
changeset
|
3 * Copyright (C) Nginx, Inc. |
7633
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
4 */ |
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
5 |
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
6 |
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
7 #ifndef _NGX_EVENT_QUIC_H_INCLUDED_ |
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
8 #define _NGX_EVENT_QUIC_H_INCLUDED_ |
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
9 |
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
10 |
7824
a5141e6b3214
Fixed includes in quic headers.
Roman Arutyunyan <arut@nginx.com>
parents:
7822
diff
changeset
|
11 #include <ngx_config.h> |
a5141e6b3214
Fixed includes in quic headers.
Roman Arutyunyan <arut@nginx.com>
parents:
7822
diff
changeset
|
12 #include <ngx_core.h> |
7636
53a5cdbe500c
QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7635
diff
changeset
|
13 |
7687
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
14 |
7912
6633f17044eb
QUIC draft-28 transport parameters support.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7910
diff
changeset
|
15 /* Supported drafts: 27, 28 */ |
7913
8b4a0a752723
Made NGX_QUIC_DRAFT_VERSION tunable from configure parameters.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7912
diff
changeset
|
16 #ifndef NGX_QUIC_DRAFT_VERSION |
7739
cb75f194f1f0
Implemented sending HANDSHAKE_DONE frame after handshake.
Vladimir Homutov <vl@nginx.com>
parents:
7737
diff
changeset
|
17 #define NGX_QUIC_DRAFT_VERSION 27 |
7913
8b4a0a752723
Made NGX_QUIC_DRAFT_VERSION tunable from configure parameters.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7912
diff
changeset
|
18 #endif |
7735
c9c3a73df6e8
Support for HTTP/3 ALPN.
Roman Arutyunyan <arut@nginx.com>
parents:
7731
diff
changeset
|
19 #define NGX_QUIC_VERSION (0xff000000 + NGX_QUIC_DRAFT_VERSION) |
7687
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
20 |
7933 | 21 #define NGX_QUIC_ALPN(s) NGX_QUIC_ALPN_DRAFT(s) |
22 #define NGX_QUIC_ALPN_DRAFT(s) "h3-" #s | |
23 #define NGX_QUIC_ALPN_STR NGX_QUIC_ALPN(NGX_QUIC_DRAFT_VERSION) | |
24 #define NGX_QUIC_ALPN_LEN (sizeof(NGX_QUIC_ALPN_STR) - 1) | |
25 | |
7822
6481427ca3fc
Respecting maximum packet size.
Vladimir Homutov <vl@nginx.com>
parents:
7811
diff
changeset
|
26 #define NGX_QUIC_MAX_SHORT_HEADER 25 /* 1 flags + 20 dcid + 4 pn */ |
6481427ca3fc
Respecting maximum packet size.
Vladimir Homutov <vl@nginx.com>
parents:
7811
diff
changeset
|
27 #define NGX_QUIC_MAX_LONG_HEADER 56 |
6481427ca3fc
Respecting maximum packet size.
Vladimir Homutov <vl@nginx.com>
parents:
7811
diff
changeset
|
28 /* 1 flags + 4 version + 2 x (1 + 20) s/dcid + 4 pn + 4 len + token len */ |
7731
d45325e90221
Limit output QUIC packets with client max_packet_size.
Roman Arutyunyan <arut@nginx.com>
parents:
7729
diff
changeset
|
29 |
7910
125cbfa77013
Renamed max_packet_size to max_udp_payload_size, from draft-28.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7860
diff
changeset
|
30 #define NGX_QUIC_MAX_UDP_PAYLOAD_SIZE 65527 |
7931
9fe7875ce4bb
QUIC: further limiting maximum QUIC packet size.
Vladimir Homutov <vl@nginx.com>
parents:
7927
diff
changeset
|
31 #define NGX_QUIC_MAX_UDP_PAYLOAD_OUT 1252 |
9fe7875ce4bb
QUIC: further limiting maximum QUIC packet size.
Vladimir Homutov <vl@nginx.com>
parents:
7927
diff
changeset
|
32 #define NGX_QUIC_MAX_UDP_PAYLOAD_OUT6 1232 |
7927
391d06a51bc0
Limited max udp payload size for outgoing packets.
Vladimir Homutov <vl@nginx.com>
parents:
7913
diff
changeset
|
33 |
7731
d45325e90221
Limit output QUIC packets with client max_packet_size.
Roman Arutyunyan <arut@nginx.com>
parents:
7729
diff
changeset
|
34 #define NGX_QUIC_DEFAULT_ACK_DELAY_EXPONENT 3 |
d45325e90221
Limit output QUIC packets with client max_packet_size.
Roman Arutyunyan <arut@nginx.com>
parents:
7729
diff
changeset
|
35 #define NGX_QUIC_DEFAULT_MAX_ACK_DELAY 25 |
d45325e90221
Limit output QUIC packets with client max_packet_size.
Roman Arutyunyan <arut@nginx.com>
parents:
7729
diff
changeset
|
36 |
7860
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
37 #define NGX_QUIC_RETRY_TIMEOUT 3000 |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
38 #define NGX_QUIC_RETRY_LIFETIME 30000 |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
39 #define NGX_QUIC_RETRY_BUFFER_SIZE 128 |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
40 /* 1 flags + 4 version + 3 x (1 + 20) s/o/dcid + itag + token(44) */ |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
41 #define NGX_QUIC_MAX_TOKEN_SIZE 32 |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
42 /* sizeof(struct in6_addr) + sizeof(ngx_msec_t) up to AES-256 block size */ |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
43 |
7987
3b107aadc9f6
QUIC: added rtt estimation.
Vladimir Homutov <vl@nginx.com>
parents:
7953
diff
changeset
|
44 /* quic-recovery, section 6.2.2, kInitialRtt */ |
3b107aadc9f6
QUIC: added rtt estimation.
Vladimir Homutov <vl@nginx.com>
parents:
7953
diff
changeset
|
45 #define NGX_QUIC_INITIAL_RTT 333 /* ms */ |
3b107aadc9f6
QUIC: added rtt estimation.
Vladimir Homutov <vl@nginx.com>
parents:
7953
diff
changeset
|
46 |
7992
909b989ec088
QUIC: reworked retransmission mechanism.
Vladimir Homutov <vl@nginx.com>
parents:
7987
diff
changeset
|
47 /* quic-recovery, section 6.1.1, Packet Threshold */ |
909b989ec088
QUIC: reworked retransmission mechanism.
Vladimir Homutov <vl@nginx.com>
parents:
7987
diff
changeset
|
48 #define NGX_QUIC_PKT_THR 3 /* packets */ |
909b989ec088
QUIC: reworked retransmission mechanism.
Vladimir Homutov <vl@nginx.com>
parents:
7987
diff
changeset
|
49 /* quic-recovery, section 6.1.2, Time Threshold */ |
909b989ec088
QUIC: reworked retransmission mechanism.
Vladimir Homutov <vl@nginx.com>
parents:
7987
diff
changeset
|
50 #define NGX_QUIC_TIME_THR 1.125 |
909b989ec088
QUIC: reworked retransmission mechanism.
Vladimir Homutov <vl@nginx.com>
parents:
7987
diff
changeset
|
51 #define NGX_QUIC_TIME_GRANULARITY 1 /* ms */ |
909b989ec088
QUIC: reworked retransmission mechanism.
Vladimir Homutov <vl@nginx.com>
parents:
7987
diff
changeset
|
52 |
7832
ad3a6f069498
Added proper handling of connection close phases.
Vladimir Homutov <vl@nginx.com>
parents:
7829
diff
changeset
|
53 #define NGX_QUIC_CC_MIN_INTERVAL 1000 /* 1s */ |
ad3a6f069498
Added proper handling of connection close phases.
Vladimir Homutov <vl@nginx.com>
parents:
7829
diff
changeset
|
54 |
7822
6481427ca3fc
Respecting maximum packet size.
Vladimir Homutov <vl@nginx.com>
parents:
7811
diff
changeset
|
55 #define NGX_QUIC_MIN_INITIAL_SIZE 1200 |
6481427ca3fc
Respecting maximum packet size.
Vladimir Homutov <vl@nginx.com>
parents:
7811
diff
changeset
|
56 |
7994
f9fbeb4ee0de
QUIC: added limit of queued data.
Vladimir Homutov <vl@nginx.com>
parents:
7993
diff
changeset
|
57 /* if we have so much data, send immediately */ |
f9fbeb4ee0de
QUIC: added limit of queued data.
Vladimir Homutov <vl@nginx.com>
parents:
7993
diff
changeset
|
58 /* TODO: configurable ? */ |
f9fbeb4ee0de
QUIC: added limit of queued data.
Vladimir Homutov <vl@nginx.com>
parents:
7993
diff
changeset
|
59 #define NGX_QUIC_MIN_DATA_NODELAY 512 /* bytes */ |
f9fbeb4ee0de
QUIC: added limit of queued data.
Vladimir Homutov <vl@nginx.com>
parents:
7993
diff
changeset
|
60 |
7746
b364af7f9f3f
Removed ngx_quic_stream_node_t.
Roman Arutyunyan <arut@nginx.com>
parents:
7739
diff
changeset
|
61 #define NGX_QUIC_STREAM_SERVER_INITIATED 0x01 |
b364af7f9f3f
Removed ngx_quic_stream_node_t.
Roman Arutyunyan <arut@nginx.com>
parents:
7739
diff
changeset
|
62 #define NGX_QUIC_STREAM_UNIDIRECTIONAL 0x02 |
b364af7f9f3f
Removed ngx_quic_stream_node_t.
Roman Arutyunyan <arut@nginx.com>
parents:
7739
diff
changeset
|
63 |
7841
eee307399229
QUIC basic congestion control.
Roman Arutyunyan <arut@nginx.com>
parents:
7837
diff
changeset
|
64 #define NGX_QUIC_STREAM_BUFSIZE 65536 |
7748
4cf00c14f11a
Safe QUIC stream creation.
Roman Arutyunyan <arut@nginx.com>
parents:
7746
diff
changeset
|
65 |
7687
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
66 |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
67 typedef struct { |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
68 /* configurable */ |
7811
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
69 ngx_msec_t max_idle_timeout; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
70 ngx_msec_t max_ack_delay; |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
71 |
7910
125cbfa77013
Renamed max_packet_size to max_udp_payload_size, from draft-28.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7860
diff
changeset
|
72 size_t max_udp_payload_size; |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7824
diff
changeset
|
73 size_t initial_max_data; |
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7824
diff
changeset
|
74 size_t initial_max_stream_data_bidi_local; |
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7824
diff
changeset
|
75 size_t initial_max_stream_data_bidi_remote; |
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7824
diff
changeset
|
76 size_t initial_max_stream_data_uni; |
7811
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
77 ngx_uint_t initial_max_streams_bidi; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
78 ngx_uint_t initial_max_streams_uni; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
79 ngx_uint_t ack_delay_exponent; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
80 ngx_uint_t disable_active_migration; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
81 ngx_uint_t active_connection_id_limit; |
7912
6633f17044eb
QUIC draft-28 transport parameters support.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7910
diff
changeset
|
82 ngx_str_t original_dcid; |
6633f17044eb
QUIC draft-28 transport parameters support.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7910
diff
changeset
|
83 ngx_str_t initial_scid; |
6633f17044eb
QUIC draft-28 transport parameters support.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7910
diff
changeset
|
84 ngx_str_t retry_scid; |
7860
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
85 |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
86 ngx_flag_t retry; |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7848
diff
changeset
|
87 u_char token_key[32]; /* AES 256 */ |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
88 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
89 /* TODO */ |
7811
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
90 u_char stateless_reset_token[16]; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
91 void *preferred_address; |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
92 } ngx_quic_tp_t; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
93 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
94 |
7811
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
95 typedef struct { |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
96 uint64_t sent; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
97 uint64_t received; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
98 ngx_queue_t frames; /* reorder queue */ |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
99 size_t total; /* size of buffered data */ |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
100 } ngx_quic_frames_stream_t; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
101 |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
102 |
7674
4ae9ac69ab93
HTTP/QUIC interface reworked.
Vladimir Homutov <vl@nginx.com>
parents:
7648
diff
changeset
|
103 struct ngx_quic_stream_s { |
7811
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
104 ngx_rbtree_node_t node; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
105 ngx_connection_t *parent; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
106 ngx_connection_t *c; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
107 uint64_t id; |
7841
eee307399229
QUIC basic congestion control.
Roman Arutyunyan <arut@nginx.com>
parents:
7837
diff
changeset
|
108 uint64_t acked; |
7842
fab75acb1f72
Respect MAX_DATA and MAX_STREAM_DATA from QUIC client.
Roman Arutyunyan <arut@nginx.com>
parents:
7841
diff
changeset
|
109 uint64_t send_max_data; |
7811
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
110 ngx_buf_t *b; |
72d20158c814
Added reordering support for STREAM frames.
Vladimir Homutov <vl@nginx.com>
parents:
7748
diff
changeset
|
111 ngx_quic_frames_stream_t fs; |
7674
4ae9ac69ab93
HTTP/QUIC interface reworked.
Vladimir Homutov <vl@nginx.com>
parents:
7648
diff
changeset
|
112 }; |
4ae9ac69ab93
HTTP/QUIC interface reworked.
Vladimir Homutov <vl@nginx.com>
parents:
7648
diff
changeset
|
113 |
7634 | 114 |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7690
diff
changeset
|
115 void ngx_quic_run(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_tp_t *tp, |
7737
8e54a17dabee
Respect QUIC max_idle_timeout.
Roman Arutyunyan <arut@nginx.com>
parents:
7735
diff
changeset
|
116 ngx_connection_handler_pt handler); |
7674
4ae9ac69ab93
HTTP/QUIC interface reworked.
Vladimir Homutov <vl@nginx.com>
parents:
7648
diff
changeset
|
117 ngx_connection_t *ngx_quic_create_uni_stream(ngx_connection_t *c); |
7953
e0f92f68e018
QUIC: Introduced ngx_quic_finalize_connection().
Roman Arutyunyan <arut@nginx.com>
parents:
7933
diff
changeset
|
118 void ngx_quic_finalize_connection(ngx_connection_t *c, ngx_uint_t err, |
e0f92f68e018
QUIC: Introduced ngx_quic_finalize_connection().
Roman Arutyunyan <arut@nginx.com>
parents:
7933
diff
changeset
|
119 const char *reason); |
7633
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
120 |
7687
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
121 |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
122 /********************************* DEBUG *************************************/ |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
123 |
7848
9d9531431c8c
Removed outdated/incorrect comments and fixed style.
Vladimir Homutov <vl@nginx.com>
parents:
7842
diff
changeset
|
124 /* #define NGX_QUIC_DEBUG_PACKETS */ /* dump packet contents */ |
9d9531431c8c
Removed outdated/incorrect comments and fixed style.
Vladimir Homutov <vl@nginx.com>
parents:
7842
diff
changeset
|
125 /* #define NGX_QUIC_DEBUG_FRAMES */ /* dump frames contents */ |
9d9531431c8c
Removed outdated/incorrect comments and fixed style.
Vladimir Homutov <vl@nginx.com>
parents:
7842
diff
changeset
|
126 /* #define NGX_QUIC_DEBUG_FRAMES_ALLOC */ /* log frames alloc/reuse/free */ |
9d9531431c8c
Removed outdated/incorrect comments and fixed style.
Vladimir Homutov <vl@nginx.com>
parents:
7842
diff
changeset
|
127 /* #define NGX_QUIC_DEBUG_CRYPTO */ |
7836 | 128 |
7687
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
129 #if (NGX_DEBUG) |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
130 |
7837
f175006124d0
Cleaned up hexdumps in debug output.
Vladimir Homutov <vl@nginx.com>
parents:
7836
diff
changeset
|
131 #define ngx_quic_hexdump(log, label, data, len) \ |
7687
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
132 do { \ |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
133 ngx_int_t m; \ |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
134 u_char buf[2048]; \ |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
135 \ |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
136 if (log->log_level & NGX_LOG_DEBUG_EVENT) { \ |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
137 m = ngx_hex_dump(buf, (u_char *) data, ngx_min(len, 1024)) - buf; \ |
7837
f175006124d0
Cleaned up hexdumps in debug output.
Vladimir Homutov <vl@nginx.com>
parents:
7836
diff
changeset
|
138 ngx_log_debug4(NGX_LOG_DEBUG_EVENT, log, 0, \ |
f175006124d0
Cleaned up hexdumps in debug output.
Vladimir Homutov <vl@nginx.com>
parents:
7836
diff
changeset
|
139 label " len:%uz data:%*s%s", \ |
f175006124d0
Cleaned up hexdumps in debug output.
Vladimir Homutov <vl@nginx.com>
parents:
7836
diff
changeset
|
140 len, m, buf, len < 2048 ? "" : "..."); \ |
7687
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
141 } \ |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
142 } while (0) |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
143 |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
144 #else |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
145 |
7837
f175006124d0
Cleaned up hexdumps in debug output.
Vladimir Homutov <vl@nginx.com>
parents:
7836
diff
changeset
|
146 #define ngx_quic_hexdump(log, fmt, data, len) |
7687
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
147 |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
148 #endif |
69345a26ba69
Split transport and crypto parts into separate files.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
149 |
7633
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
150 #endif /* _NGX_EVENT_QUIC_H_INCLUDED_ */ |