Mercurial > hg > nginx-quic
annotate src/http/v3/ngx_http_v3_module.c @ 7908:f27fdf86275d quic
Fixed return codes in ngx_quic_add_handshake_data() callback.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 29 May 2020 12:50:20 +0300 |
parents | 7ea34e13937f |
children | 125cbfa77013 |
rev | line source |
---|---|
7681 | 1 |
2 /* | |
3 * Copyright (C) Nginx, Inc. | |
4 * Copyright (C) Roman Arutyunyan | |
5 */ | |
6 | |
7 | |
8 #include <ngx_config.h> | |
9 #include <ngx_core.h> | |
10 #include <ngx_http.h> | |
11 | |
12 | |
7830
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
13 static char *ngx_http_v3_max_ack_delay(ngx_conf_t *cf, void *post, void *data); |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
14 static char *ngx_http_v3_max_packet_size(ngx_conf_t *cf, void *post, |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
15 void *data); |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
16 |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
17 |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
18 static ngx_conf_post_t ngx_http_v3_max_ack_delay_post = |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
19 { ngx_http_v3_max_ack_delay }; |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
20 static ngx_conf_post_t ngx_http_v3_max_packet_size_post = |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
21 { ngx_http_v3_max_packet_size }; |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
22 static ngx_conf_num_bounds_t ngx_http_v3_ack_delay_exponent_bounds = |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
23 { ngx_conf_check_num_bounds, 0, 20 }; |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
24 static ngx_conf_num_bounds_t ngx_http_v3_active_connection_id_limit_bounds = |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
25 { ngx_conf_check_num_bounds, 2, -1 }; |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
26 |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
27 |
7681 | 28 static ngx_command_t ngx_http_v3_commands[] = { |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
29 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
30 { ngx_string("quic_max_idle_timeout"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
31 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
32 ngx_conf_set_msec_slot, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
33 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
34 offsetof(ngx_http_v3_srv_conf_t, quic.max_idle_timeout), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
35 NULL }, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
36 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
37 { ngx_string("quic_max_ack_delay"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
38 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
39 ngx_conf_set_msec_slot, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
40 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
41 offsetof(ngx_http_v3_srv_conf_t, quic.max_ack_delay), |
7830
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
42 &ngx_http_v3_max_ack_delay_post }, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
43 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
44 { ngx_string("quic_max_packet_size"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
45 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
46 ngx_conf_set_size_slot, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
47 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
48 offsetof(ngx_http_v3_srv_conf_t, quic.max_packet_size), |
7830
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
49 &ngx_http_v3_max_packet_size_post }, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
50 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
51 { ngx_string("quic_initial_max_data"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
52 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
53 ngx_conf_set_size_slot, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
54 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
55 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_data), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
56 NULL }, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
57 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
58 { ngx_string("quic_initial_max_stream_data_bidi_local"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
59 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
60 ngx_conf_set_size_slot, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
61 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
62 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_stream_data_bidi_local), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
63 NULL }, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
64 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
65 { ngx_string("quic_initial_max_stream_data_bidi_remote"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
66 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
67 ngx_conf_set_size_slot, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
68 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
69 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_stream_data_bidi_remote), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
70 NULL }, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
71 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
72 { ngx_string("quic_initial_max_stream_data_uni"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
73 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
74 ngx_conf_set_size_slot, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
75 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
76 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_stream_data_uni), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
77 NULL }, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
78 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
79 { ngx_string("quic_initial_max_streams_bidi"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
80 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
81 ngx_conf_set_num_slot, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
82 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
83 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_streams_bidi), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
84 NULL }, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
85 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
86 { ngx_string("quic_initial_max_streams_uni"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
87 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
88 ngx_conf_set_num_slot, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
89 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
90 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_streams_uni), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
91 NULL }, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
92 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
93 { ngx_string("quic_ack_delay_exponent"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
94 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
95 ngx_conf_set_num_slot, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
96 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
97 offsetof(ngx_http_v3_srv_conf_t, quic.ack_delay_exponent), |
7830
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
98 &ngx_http_v3_ack_delay_exponent_bounds }, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
99 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
100 { ngx_string("quic_active_migration"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
101 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
102 ngx_conf_set_num_slot, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
103 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
104 offsetof(ngx_http_v3_srv_conf_t, quic.disable_active_migration), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
105 NULL }, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
106 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
107 { ngx_string("quic_active_connection_id_limit"), |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
108 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
109 ngx_conf_set_num_slot, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
110 NGX_HTTP_SRV_CONF_OFFSET, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
111 offsetof(ngx_http_v3_srv_conf_t, quic.active_connection_id_limit), |
7830
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
112 &ngx_http_v3_active_connection_id_limit_bounds }, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
113 |
7860
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
114 { ngx_string("quic_retry"), |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
115 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG, |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
116 ngx_conf_set_flag_slot, |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
117 NGX_HTTP_SRV_CONF_OFFSET, |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
118 offsetof(ngx_http_v3_srv_conf_t, quic.retry), |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
119 NULL }, |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
120 |
7681 | 121 ngx_null_command |
122 }; | |
123 | |
124 | |
7714
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
125 static ngx_int_t ngx_http_variable_quic(ngx_http_request_t *r, |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
126 ngx_http_variable_value_t *v, uintptr_t data); |
7763
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
127 static ngx_int_t ngx_http_variable_http3(ngx_http_request_t *r, |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
128 ngx_http_variable_value_t *v, uintptr_t data); |
7714
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
129 static ngx_int_t ngx_http_v3_add_variables(ngx_conf_t *cf); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
130 static void *ngx_http_v3_create_srv_conf(ngx_conf_t *cf); |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
131 static char *ngx_http_v3_merge_srv_conf(ngx_conf_t *cf, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
132 void *parent, void *child); |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
133 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
134 |
7681 | 135 static ngx_http_module_t ngx_http_v3_module_ctx = { |
7714
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
136 ngx_http_v3_add_variables, /* preconfiguration */ |
7681 | 137 NULL, /* postconfiguration */ |
138 | |
139 NULL, /* create main configuration */ | |
140 NULL, /* init main configuration */ | |
141 | |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
142 ngx_http_v3_create_srv_conf, /* create server configuration */ |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
143 ngx_http_v3_merge_srv_conf, /* merge server configuration */ |
7681 | 144 |
145 NULL, /* create location configuration */ | |
146 NULL /* merge location configuration */ | |
147 }; | |
148 | |
149 | |
150 ngx_module_t ngx_http_v3_module = { | |
151 NGX_MODULE_V1, | |
152 &ngx_http_v3_module_ctx, /* module context */ | |
153 ngx_http_v3_commands, /* module directives */ | |
154 NGX_HTTP_MODULE, /* module type */ | |
155 NULL, /* init master */ | |
156 NULL, /* init module */ | |
157 NULL, /* init process */ | |
158 NULL, /* init thread */ | |
159 NULL, /* exit thread */ | |
160 NULL, /* exit process */ | |
161 NULL, /* exit master */ | |
162 NGX_MODULE_V1_PADDING | |
163 }; | |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
164 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
165 |
7714
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
166 static ngx_http_variable_t ngx_http_v3_vars[] = { |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
167 { ngx_string("quic"), NULL, ngx_http_variable_quic, |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
168 0, 0, 0 }, |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
169 |
7763
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
170 { ngx_string("http3"), NULL, ngx_http_variable_http3, |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
171 0, 0, 0 }, |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
172 |
7714
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
173 ngx_http_null_variable |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
174 }; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
175 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
176 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
177 static ngx_int_t |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
178 ngx_http_variable_quic(ngx_http_request_t *r, |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
179 ngx_http_variable_value_t *v, uintptr_t data) |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
180 { |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
181 if (r->connection->qs) { |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
182 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
183 v->len = 4; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
184 v->valid = 1; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
185 v->no_cacheable = 1; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
186 v->not_found = 0; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
187 v->data = (u_char *) "quic"; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
188 return NGX_OK; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
189 } |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
190 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
191 v->not_found = 1; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
192 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
193 return NGX_OK; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
194 } |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
195 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
196 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
197 static ngx_int_t |
7763
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
198 ngx_http_variable_http3(ngx_http_request_t *r, |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
199 ngx_http_variable_value_t *v, uintptr_t data) |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
200 { |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
201 v->valid = 1; |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
202 v->no_cacheable = 1; |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
203 v->not_found = 0; |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
204 |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
205 v->data = ngx_pnalloc(r->pool, sizeof("h3-xx") - 1); |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
206 if (v->data == NULL) { |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
207 return NGX_ERROR; |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
208 } |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
209 |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
210 v->len = ngx_sprintf(v->data, "h3-%d", NGX_QUIC_DRAFT_VERSION) - v->data; |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
211 |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
212 return NGX_OK; |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
213 } |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
214 |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
215 |
0b95c2041887
HTTP/3: http3 variable.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7737
diff
changeset
|
216 static ngx_int_t |
7714
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
217 ngx_http_v3_add_variables(ngx_conf_t *cf) |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
218 { |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
219 ngx_http_variable_t *var, *v; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
220 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
221 for (v = ngx_http_v3_vars; v->name.len; v++) { |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
222 var = ngx_http_add_variable(cf, &v->name, v->flags); |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
223 if (var == NULL) { |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
224 return NGX_ERROR; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
225 } |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
226 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
227 var->get_handler = v->get_handler; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
228 var->data = v->data; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
229 } |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
230 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
231 return NGX_OK; |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
232 } |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
233 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
234 |
abb7c1a4c9d5
Adedd the http "quic" variable.
Vladimir Homutov <vl@nginx.com>
parents:
7713
diff
changeset
|
235 |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
236 static void * |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
237 ngx_http_v3_create_srv_conf(ngx_conf_t *cf) |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
238 { |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
239 ngx_http_v3_srv_conf_t *v3cf; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
240 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
241 v3cf = ngx_pcalloc(cf->pool, sizeof(ngx_http_v3_srv_conf_t)); |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
242 if (v3cf == NULL) { |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
243 return NULL; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
244 } |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
245 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
246 /* |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
247 * set by ngx_pcalloc(): |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
248 * v3cf->quic.original_connection_id = 0; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
249 * v3cf->quic.stateless_reset_token = { 0 } |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
250 * conf->quic.preferred_address = NULL |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
251 */ |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
252 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
253 v3cf->quic.max_idle_timeout = NGX_CONF_UNSET_MSEC; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
254 v3cf->quic.max_ack_delay = NGX_CONF_UNSET_MSEC; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
255 |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
256 v3cf->quic.max_packet_size = NGX_CONF_UNSET_SIZE; |
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
257 v3cf->quic.initial_max_data = NGX_CONF_UNSET_SIZE; |
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
258 v3cf->quic.initial_max_stream_data_bidi_local = NGX_CONF_UNSET_SIZE; |
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
259 v3cf->quic.initial_max_stream_data_bidi_remote = NGX_CONF_UNSET_SIZE; |
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
260 v3cf->quic.initial_max_stream_data_uni = NGX_CONF_UNSET_SIZE; |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
261 v3cf->quic.initial_max_streams_bidi = NGX_CONF_UNSET_UINT; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
262 v3cf->quic.initial_max_streams_uni = NGX_CONF_UNSET_UINT; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
263 v3cf->quic.ack_delay_exponent = NGX_CONF_UNSET_UINT; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
264 v3cf->quic.disable_active_migration = NGX_CONF_UNSET_UINT; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
265 v3cf->quic.active_connection_id_limit = NGX_CONF_UNSET_UINT; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
266 |
7860
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
267 v3cf->quic.retry = NGX_CONF_UNSET; |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
268 |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
269 return v3cf; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
270 } |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
271 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
272 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
273 static char * |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
274 ngx_http_v3_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child) |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
275 { |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
276 ngx_http_v3_srv_conf_t *prev = parent; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
277 ngx_http_v3_srv_conf_t *conf = child; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
278 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
279 ngx_conf_merge_msec_value(conf->quic.max_idle_timeout, |
7737
8e54a17dabee
Respect QUIC max_idle_timeout.
Roman Arutyunyan <arut@nginx.com>
parents:
7731
diff
changeset
|
280 prev->quic.max_idle_timeout, 60000); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
281 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
282 ngx_conf_merge_msec_value(conf->quic.max_ack_delay, |
7731
d45325e90221
Limit output QUIC packets with client max_packet_size.
Roman Arutyunyan <arut@nginx.com>
parents:
7714
diff
changeset
|
283 prev->quic.max_ack_delay, |
d45325e90221
Limit output QUIC packets with client max_packet_size.
Roman Arutyunyan <arut@nginx.com>
parents:
7714
diff
changeset
|
284 NGX_QUIC_DEFAULT_MAX_ACK_DELAY); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
285 |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
286 ngx_conf_merge_size_value(conf->quic.max_packet_size, |
7731
d45325e90221
Limit output QUIC packets with client max_packet_size.
Roman Arutyunyan <arut@nginx.com>
parents:
7714
diff
changeset
|
287 prev->quic.max_packet_size, |
d45325e90221
Limit output QUIC packets with client max_packet_size.
Roman Arutyunyan <arut@nginx.com>
parents:
7714
diff
changeset
|
288 NGX_QUIC_DEFAULT_MAX_PACKET_SIZE); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
289 |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
290 ngx_conf_merge_size_value(conf->quic.initial_max_data, |
7815
0f9e9786b90d
Added primitive flow control mechanisms.
Vladimir Homutov <vl@nginx.com>
parents:
7763
diff
changeset
|
291 prev->quic.initial_max_data, |
0f9e9786b90d
Added primitive flow control mechanisms.
Vladimir Homutov <vl@nginx.com>
parents:
7763
diff
changeset
|
292 16 * NGX_QUIC_STREAM_BUFSIZE); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
293 |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
294 ngx_conf_merge_size_value(conf->quic.initial_max_stream_data_bidi_local, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
295 prev->quic.initial_max_stream_data_bidi_local, |
7815
0f9e9786b90d
Added primitive flow control mechanisms.
Vladimir Homutov <vl@nginx.com>
parents:
7763
diff
changeset
|
296 NGX_QUIC_STREAM_BUFSIZE); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
297 |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
298 ngx_conf_merge_size_value(conf->quic.initial_max_stream_data_bidi_remote, |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
299 prev->quic.initial_max_stream_data_bidi_remote, |
7815
0f9e9786b90d
Added primitive flow control mechanisms.
Vladimir Homutov <vl@nginx.com>
parents:
7763
diff
changeset
|
300 NGX_QUIC_STREAM_BUFSIZE); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
301 |
7829
d73516830236
HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7817
diff
changeset
|
302 ngx_conf_merge_size_value(conf->quic.initial_max_stream_data_uni, |
7815
0f9e9786b90d
Added primitive flow control mechanisms.
Vladimir Homutov <vl@nginx.com>
parents:
7763
diff
changeset
|
303 prev->quic.initial_max_stream_data_uni, |
0f9e9786b90d
Added primitive flow control mechanisms.
Vladimir Homutov <vl@nginx.com>
parents:
7763
diff
changeset
|
304 NGX_QUIC_STREAM_BUFSIZE); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
305 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
306 ngx_conf_merge_uint_value(conf->quic.initial_max_streams_bidi, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
307 prev->quic.initial_max_streams_bidi, 16); |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
308 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
309 ngx_conf_merge_uint_value(conf->quic.initial_max_streams_uni, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
310 prev->quic.initial_max_streams_uni, 16); |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
311 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
312 ngx_conf_merge_uint_value(conf->quic.ack_delay_exponent, |
7731
d45325e90221
Limit output QUIC packets with client max_packet_size.
Roman Arutyunyan <arut@nginx.com>
parents:
7714
diff
changeset
|
313 prev->quic.ack_delay_exponent, |
d45325e90221
Limit output QUIC packets with client max_packet_size.
Roman Arutyunyan <arut@nginx.com>
parents:
7714
diff
changeset
|
314 NGX_QUIC_DEFAULT_ACK_DELAY_EXPONENT); |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
315 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
316 ngx_conf_merge_uint_value(conf->quic.disable_active_migration, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
317 prev->quic.disable_active_migration, 1); |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
318 |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
319 ngx_conf_merge_uint_value(conf->quic.active_connection_id_limit, |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
320 prev->quic.active_connection_id_limit, 2); |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
321 |
7860
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
322 ngx_conf_merge_value(conf->quic.retry, prev->quic.retry, 0); |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
323 |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
324 if (conf->quic.retry) { |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
325 if (RAND_bytes(conf->quic.token_key, sizeof(conf->quic.token_key)) <= 0) { |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
326 return NGX_CONF_ERROR; |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
327 } |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
328 } |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
329 |
7ea34e13937f
Address validation using Retry packets.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7830
diff
changeset
|
330 |
7830
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
331 return NGX_CONF_OK; |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
332 } |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
333 |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
334 |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
335 static char * |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
336 ngx_http_v3_max_ack_delay(ngx_conf_t *cf, void *post, void *data) |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
337 { |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
338 ngx_msec_t *sp = data; |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
339 |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
340 if (*sp > 16384) { |
7817
a8fc0ab54cea
Added handling of incorrect values in TP configuration.
Vladimir Homutov <vl@nginx.com>
parents:
7815
diff
changeset
|
341 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
7830
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
342 "\"quic_max_ack_delay\" must be less than 16384"); |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
343 |
7817
a8fc0ab54cea
Added handling of incorrect values in TP configuration.
Vladimir Homutov <vl@nginx.com>
parents:
7815
diff
changeset
|
344 return NGX_CONF_ERROR; |
a8fc0ab54cea
Added handling of incorrect values in TP configuration.
Vladimir Homutov <vl@nginx.com>
parents:
7815
diff
changeset
|
345 } |
a8fc0ab54cea
Added handling of incorrect values in TP configuration.
Vladimir Homutov <vl@nginx.com>
parents:
7815
diff
changeset
|
346 |
7713
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
347 return NGX_CONF_OK; |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
348 } |
e9891e8ee975
Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents:
7681
diff
changeset
|
349 |
7830
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
350 |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
351 static char * |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
352 ngx_http_v3_max_packet_size(ngx_conf_t *cf, void *post, void *data) |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
353 { |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
354 size_t *sp = data; |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
355 |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
356 if (*sp < NGX_QUIC_MIN_INITIAL_SIZE |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
357 || *sp > NGX_QUIC_DEFAULT_MAX_PACKET_SIZE) |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
358 { |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
359 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
360 "\"quic_max_packet_size\" must be between %d and %d", |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
361 NGX_QUIC_MIN_INITIAL_SIZE, |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
362 NGX_QUIC_DEFAULT_MAX_PACKET_SIZE); |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
363 |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
364 return NGX_CONF_ERROR; |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
365 } |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
366 |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
367 return NGX_CONF_OK; |
036164360fa9
HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7829
diff
changeset
|
368 } |