Mercurial > hg > nginx-quic
annotate src/http/modules/ngx_http_quic_module.c @ 8387:76f476ce4d31 quic
QUIC: distinct files for connection migration.
The connection migration-related code from quic.c with dependencies is moved
into separate file.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Wed, 31 Mar 2021 14:57:15 +0300 |
parents | 55aabb7269e7 |
children | b4e6b7049984 |
rev | line source |
---|---|
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
1 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
2 /* |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
3 * Copyright (C) Nginx, Inc. |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
4 * Copyright (C) Roman Arutyunyan |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
5 */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
6 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
7 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
8 #include <ngx_config.h> |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
9 #include <ngx_core.h> |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
10 #include <ngx_http.h> |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
11 |
8287
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
12 #include <ngx_event_quic_protection.h> |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
13 |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
14 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
15 static ngx_int_t ngx_http_variable_quic(ngx_http_request_t *r, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
16 ngx_http_variable_value_t *v, uintptr_t data); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
17 static ngx_int_t ngx_http_quic_add_variables(ngx_conf_t *cf); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
18 static void *ngx_http_quic_create_srv_conf(ngx_conf_t *cf); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
19 static char *ngx_http_quic_merge_srv_conf(ngx_conf_t *cf, void *parent, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
20 void *child); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
21 static char *ngx_http_quic_max_ack_delay(ngx_conf_t *cf, void *post, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
22 void *data); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
23 static char *ngx_http_quic_max_udp_payload_size(ngx_conf_t *cf, void *post, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
24 void *data); |
8287
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
25 static char *ngx_http_quic_host_key(ngx_conf_t *cf, ngx_command_t *cmd, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
26 void *conf); |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
27 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
28 static ngx_conf_post_t ngx_http_quic_max_ack_delay_post = |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
29 { ngx_http_quic_max_ack_delay }; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
30 static ngx_conf_post_t ngx_http_quic_max_udp_payload_size_post = |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
31 { ngx_http_quic_max_udp_payload_size }; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
32 static ngx_conf_num_bounds_t ngx_http_quic_ack_delay_exponent_bounds = |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
33 { ngx_conf_check_num_bounds, 0, 20 }; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
34 static ngx_conf_num_bounds_t ngx_http_quic_active_connection_id_limit_bounds = |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
35 { ngx_conf_check_num_bounds, 2, -1 }; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
36 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
37 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
38 static ngx_command_t ngx_http_quic_commands[] = { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
39 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
40 { ngx_string("quic_max_idle_timeout"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
41 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
42 ngx_conf_set_msec_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
43 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
44 offsetof(ngx_quic_conf_t, tp.max_idle_timeout), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
45 NULL }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
46 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
47 { ngx_string("quic_max_ack_delay"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
48 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
49 ngx_conf_set_msec_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
50 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
51 offsetof(ngx_quic_conf_t, tp.max_ack_delay), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
52 &ngx_http_quic_max_ack_delay_post }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
53 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
54 { ngx_string("quic_max_udp_payload_size"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
55 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
56 ngx_conf_set_size_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
57 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
58 offsetof(ngx_quic_conf_t, tp.max_udp_payload_size), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
59 &ngx_http_quic_max_udp_payload_size_post }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
60 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
61 { ngx_string("quic_initial_max_data"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
62 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
63 ngx_conf_set_size_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
64 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
65 offsetof(ngx_quic_conf_t, tp.initial_max_data), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
66 NULL }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
67 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
68 { ngx_string("quic_initial_max_stream_data_bidi_local"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
69 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
70 ngx_conf_set_size_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
71 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
72 offsetof(ngx_quic_conf_t, tp.initial_max_stream_data_bidi_local), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
73 NULL }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
74 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
75 { ngx_string("quic_initial_max_stream_data_bidi_remote"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
76 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
77 ngx_conf_set_size_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
78 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
79 offsetof(ngx_quic_conf_t, tp.initial_max_stream_data_bidi_remote), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
80 NULL }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
81 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
82 { ngx_string("quic_initial_max_stream_data_uni"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
83 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
84 ngx_conf_set_size_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
85 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
86 offsetof(ngx_quic_conf_t, tp.initial_max_stream_data_uni), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
87 NULL }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
88 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
89 { ngx_string("quic_initial_max_streams_bidi"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
90 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
91 ngx_conf_set_num_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
92 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
93 offsetof(ngx_quic_conf_t, tp.initial_max_streams_bidi), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
94 NULL }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
95 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
96 { ngx_string("quic_initial_max_streams_uni"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
97 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
98 ngx_conf_set_num_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
99 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
100 offsetof(ngx_quic_conf_t, tp.initial_max_streams_uni), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
101 NULL }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
102 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
103 { ngx_string("quic_ack_delay_exponent"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
104 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
105 ngx_conf_set_num_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
106 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
107 offsetof(ngx_quic_conf_t, tp.ack_delay_exponent), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
108 &ngx_http_quic_ack_delay_exponent_bounds }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
109 |
8198
45db1b5c1706
QUIC: connection multiplexing per port.
Roman Arutyunyan <arut@nginx.com>
parents:
8101
diff
changeset
|
110 { ngx_string("quic_disable_active_migration"), |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
111 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
8198
45db1b5c1706
QUIC: connection multiplexing per port.
Roman Arutyunyan <arut@nginx.com>
parents:
8101
diff
changeset
|
112 ngx_conf_set_flag_slot, |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
113 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
114 offsetof(ngx_quic_conf_t, tp.disable_active_migration), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
115 NULL }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
116 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
117 { ngx_string("quic_active_connection_id_limit"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
118 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
119 ngx_conf_set_num_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
120 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
121 offsetof(ngx_quic_conf_t, tp.active_connection_id_limit), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
122 &ngx_http_quic_active_connection_id_limit_bounds }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
123 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
124 { ngx_string("quic_retry"), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
125 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
126 ngx_conf_set_flag_slot, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
127 NGX_HTTP_SRV_CONF_OFFSET, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
128 offsetof(ngx_quic_conf_t, retry), |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
129 NULL }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
130 |
8287
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
131 { ngx_string("quic_host_key"), |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
132 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
133 ngx_http_quic_host_key, |
8100
b31c02454539
QUIC: added stateless reset support.
Vladimir Homutov <vl@nginx.com>
parents:
8000
diff
changeset
|
134 NGX_HTTP_SRV_CONF_OFFSET, |
8287
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
135 0, |
8100
b31c02454539
QUIC: added stateless reset support.
Vladimir Homutov <vl@nginx.com>
parents:
8000
diff
changeset
|
136 NULL }, |
b31c02454539
QUIC: added stateless reset support.
Vladimir Homutov <vl@nginx.com>
parents:
8000
diff
changeset
|
137 |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
138 ngx_null_command |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
139 }; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
140 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
141 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
142 static ngx_http_module_t ngx_http_quic_module_ctx = { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
143 ngx_http_quic_add_variables, /* preconfiguration */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
144 NULL, /* postconfiguration */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
145 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
146 NULL, /* create main configuration */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
147 NULL, /* init main configuration */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
148 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
149 ngx_http_quic_create_srv_conf, /* create server configuration */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
150 ngx_http_quic_merge_srv_conf, /* merge server configuration */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
151 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
152 NULL, /* create location configuration */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
153 NULL /* merge location configuration */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
154 }; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
155 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
156 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
157 ngx_module_t ngx_http_quic_module = { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
158 NGX_MODULE_V1, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
159 &ngx_http_quic_module_ctx, /* module context */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
160 ngx_http_quic_commands, /* module directives */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
161 NGX_HTTP_MODULE, /* module type */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
162 NULL, /* init master */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
163 NULL, /* init module */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
164 NULL, /* init process */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
165 NULL, /* init thread */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
166 NULL, /* exit thread */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
167 NULL, /* exit process */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
168 NULL, /* exit master */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
169 NGX_MODULE_V1_PADDING |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
170 }; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
171 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
172 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
173 static ngx_http_variable_t ngx_http_quic_vars[] = { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
174 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
175 { ngx_string("quic"), NULL, ngx_http_variable_quic, 0, 0, 0 }, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
176 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
177 ngx_http_null_variable |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
178 }; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
179 |
8287
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
180 static ngx_str_t ngx_http_quic_salt = ngx_string("ngx_quic"); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
181 |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
182 |
8272
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
183 ngx_int_t |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
184 ngx_http_quic_init(ngx_connection_t *c) |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
185 { |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
186 ngx_quic_conf_t *qcf; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
187 ngx_http_connection_t *hc, *phc; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
188 ngx_http_core_loc_conf_t *clcf; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
189 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
190 hc = c->data; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
191 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
192 hc->ssl = 1; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
193 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
194 if (c->quic == NULL) { |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
195 c->log->connection = c->number; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
196 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
197 qcf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_quic_module); |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
198 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
199 ngx_quic_run(c, qcf); |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
200 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
201 return NGX_DONE; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
202 } |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
203 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
204 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http init quic stream"); |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
205 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
206 phc = c->quic->parent->data; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
207 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
208 if (phc->ssl_servername) { |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
209 hc->ssl_servername = phc->ssl_servername; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
210 hc->conf_ctx = phc->conf_ctx; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
211 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
212 clcf = ngx_http_get_module_loc_conf(hc->conf_ctx, ngx_http_core_module); |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
213 ngx_set_connection_log(c, clcf->error_log); |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
214 } |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
215 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
216 return NGX_OK; |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
217 } |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
218 |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8204
diff
changeset
|
219 |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
220 static ngx_int_t |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
221 ngx_http_variable_quic(ngx_http_request_t *r, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
222 ngx_http_variable_value_t *v, uintptr_t data) |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
223 { |
8200
279ad36f2f4b
QUIC: renamed c->qs to c->quic.
Roman Arutyunyan <arut@nginx.com>
parents:
8198
diff
changeset
|
224 if (r->connection->quic) { |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
225 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
226 v->len = 4; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
227 v->valid = 1; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
228 v->no_cacheable = 1; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
229 v->not_found = 0; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
230 v->data = (u_char *) "quic"; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
231 return NGX_OK; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
232 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
233 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
234 v->not_found = 1; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
235 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
236 return NGX_OK; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
237 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
238 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
239 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
240 static ngx_int_t |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
241 ngx_http_quic_add_variables(ngx_conf_t *cf) |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
242 { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
243 ngx_http_variable_t *var, *v; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
244 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
245 for (v = ngx_http_quic_vars; v->name.len; v++) { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
246 var = ngx_http_add_variable(cf, &v->name, v->flags); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
247 if (var == NULL) { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
248 return NGX_ERROR; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
249 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
250 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
251 var->get_handler = v->get_handler; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
252 var->data = v->data; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
253 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
254 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
255 return NGX_OK; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
256 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
257 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
258 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
259 static void * |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
260 ngx_http_quic_create_srv_conf(ngx_conf_t *cf) |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
261 { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
262 ngx_quic_conf_t *conf; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
263 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
264 conf = ngx_pcalloc(cf->pool, sizeof(ngx_quic_conf_t)); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
265 if (conf == NULL) { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
266 return NULL; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
267 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
268 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
269 /* |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
270 * set by ngx_pcalloc(): |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
271 * |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
272 * conf->tp.original_dcid = { 0, NULL }; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
273 * conf->tp.initial_scid = { 0, NULL }; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
274 * conf->tp.retry_scid = { 0, NULL }; |
8100
b31c02454539
QUIC: added stateless reset support.
Vladimir Homutov <vl@nginx.com>
parents:
8000
diff
changeset
|
275 * conf->tp.sr_token = { 0 } |
b31c02454539
QUIC: added stateless reset support.
Vladimir Homutov <vl@nginx.com>
parents:
8000
diff
changeset
|
276 * conf->tp.sr_enabled = 0 |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
277 * conf->tp.preferred_address = NULL |
8287
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
278 * conf->host_key = { 0, NULL } |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
279 */ |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
280 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
281 conf->tp.max_idle_timeout = NGX_CONF_UNSET_MSEC; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
282 conf->tp.max_ack_delay = NGX_CONF_UNSET_MSEC; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
283 conf->tp.max_udp_payload_size = NGX_CONF_UNSET_SIZE; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
284 conf->tp.initial_max_data = NGX_CONF_UNSET_SIZE; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
285 conf->tp.initial_max_stream_data_bidi_local = NGX_CONF_UNSET_SIZE; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
286 conf->tp.initial_max_stream_data_bidi_remote = NGX_CONF_UNSET_SIZE; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
287 conf->tp.initial_max_stream_data_uni = NGX_CONF_UNSET_SIZE; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
288 conf->tp.initial_max_streams_bidi = NGX_CONF_UNSET_UINT; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
289 conf->tp.initial_max_streams_uni = NGX_CONF_UNSET_UINT; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
290 conf->tp.ack_delay_exponent = NGX_CONF_UNSET_UINT; |
8198
45db1b5c1706
QUIC: connection multiplexing per port.
Roman Arutyunyan <arut@nginx.com>
parents:
8101
diff
changeset
|
291 conf->tp.disable_active_migration = NGX_CONF_UNSET; |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
292 conf->tp.active_connection_id_limit = NGX_CONF_UNSET_UINT; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
293 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
294 conf->retry = NGX_CONF_UNSET; |
8000
893b3313f53c
QUIC: added "quic" listen parameter in Stream.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
295 conf->require_alpn = 1; |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
296 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
297 return conf; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
298 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
299 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
300 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
301 static char * |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
302 ngx_http_quic_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child) |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
303 { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
304 ngx_quic_conf_t *prev = parent; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
305 ngx_quic_conf_t *conf = child; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
306 |
8101
bed310672f39
QUIC: moved ssl configuration pointer to quic configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8100
diff
changeset
|
307 ngx_http_ssl_srv_conf_t *sscf; |
bed310672f39
QUIC: moved ssl configuration pointer to quic configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8100
diff
changeset
|
308 |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
309 ngx_conf_merge_msec_value(conf->tp.max_idle_timeout, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
310 prev->tp.max_idle_timeout, 60000); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
311 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
312 ngx_conf_merge_msec_value(conf->tp.max_ack_delay, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
313 prev->tp.max_ack_delay, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
314 NGX_QUIC_DEFAULT_MAX_ACK_DELAY); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
315 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
316 ngx_conf_merge_size_value(conf->tp.max_udp_payload_size, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
317 prev->tp.max_udp_payload_size, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
318 NGX_QUIC_MAX_UDP_PAYLOAD_SIZE); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
319 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
320 ngx_conf_merge_size_value(conf->tp.initial_max_data, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
321 prev->tp.initial_max_data, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
322 16 * NGX_QUIC_STREAM_BUFSIZE); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
323 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
324 ngx_conf_merge_size_value(conf->tp.initial_max_stream_data_bidi_local, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
325 prev->tp.initial_max_stream_data_bidi_local, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
326 NGX_QUIC_STREAM_BUFSIZE); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
327 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
328 ngx_conf_merge_size_value(conf->tp.initial_max_stream_data_bidi_remote, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
329 prev->tp.initial_max_stream_data_bidi_remote, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
330 NGX_QUIC_STREAM_BUFSIZE); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
331 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
332 ngx_conf_merge_size_value(conf->tp.initial_max_stream_data_uni, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
333 prev->tp.initial_max_stream_data_uni, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
334 NGX_QUIC_STREAM_BUFSIZE); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
335 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
336 ngx_conf_merge_uint_value(conf->tp.initial_max_streams_bidi, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
337 prev->tp.initial_max_streams_bidi, 16); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
338 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
339 ngx_conf_merge_uint_value(conf->tp.initial_max_streams_uni, |
8361
55aabb7269e7
HTTP/3: set initial_max_streams_uni default value to 3.
Roman Arutyunyan <arut@nginx.com>
parents:
8287
diff
changeset
|
340 prev->tp.initial_max_streams_uni, 3); |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
341 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
342 ngx_conf_merge_uint_value(conf->tp.ack_delay_exponent, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
343 prev->tp.ack_delay_exponent, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
344 NGX_QUIC_DEFAULT_ACK_DELAY_EXPONENT); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
345 |
8198
45db1b5c1706
QUIC: connection multiplexing per port.
Roman Arutyunyan <arut@nginx.com>
parents:
8101
diff
changeset
|
346 ngx_conf_merge_value(conf->tp.disable_active_migration, |
45db1b5c1706
QUIC: connection multiplexing per port.
Roman Arutyunyan <arut@nginx.com>
parents:
8101
diff
changeset
|
347 prev->tp.disable_active_migration, 0); |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
348 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
349 ngx_conf_merge_uint_value(conf->tp.active_connection_id_limit, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
350 prev->tp.active_connection_id_limit, 2); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
351 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
352 ngx_conf_merge_value(conf->retry, prev->retry, 0); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
353 |
8287
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
354 ngx_conf_merge_str_value(conf->host_key, prev->host_key, ""); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
355 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
356 if (conf->host_key.len == 0) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
357 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
358 conf->host_key.len = NGX_QUIC_DEFAULT_HOST_KEY_LEN; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
359 conf->host_key.data = ngx_palloc(cf->pool, conf->host_key.len); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
360 if (conf->host_key.data == NULL) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
361 return NGX_CONF_ERROR; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
362 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
363 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
364 if (RAND_bytes(conf->host_key.data, NGX_QUIC_DEFAULT_HOST_KEY_LEN) |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
365 <= 0) |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
366 { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
367 return NGX_CONF_ERROR; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
368 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
369 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
370 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
371 if (ngx_quic_derive_key(cf->log, "av_token_key", |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
372 &conf->host_key, &ngx_http_quic_salt, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
373 conf->av_token_key, NGX_QUIC_AV_KEY_LEN) |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
374 != NGX_OK) |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
375 { |
8279 | 376 return NGX_CONF_ERROR; |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
377 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
378 |
8287
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
379 if (ngx_quic_derive_key(cf->log, "sr_token_key", |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
380 &conf->host_key, &ngx_http_quic_salt, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
381 conf->sr_token_key, NGX_QUIC_SR_KEY_LEN) |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
382 != NGX_OK) |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
383 { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
384 return NGX_CONF_ERROR; |
8204
831d1960826f
QUIC: generate default stateless reset token key.
Roman Arutyunyan <arut@nginx.com>
parents:
8200
diff
changeset
|
385 } |
831d1960826f
QUIC: generate default stateless reset token key.
Roman Arutyunyan <arut@nginx.com>
parents:
8200
diff
changeset
|
386 |
8101
bed310672f39
QUIC: moved ssl configuration pointer to quic configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8100
diff
changeset
|
387 sscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_ssl_module); |
bed310672f39
QUIC: moved ssl configuration pointer to quic configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8100
diff
changeset
|
388 conf->ssl = &sscf->ssl; |
bed310672f39
QUIC: moved ssl configuration pointer to quic configuration.
Vladimir Homutov <vl@nginx.com>
parents:
8100
diff
changeset
|
389 |
7999
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
390 return NGX_CONF_OK; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
391 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
392 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
393 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
394 static char * |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
395 ngx_http_quic_max_ack_delay(ngx_conf_t *cf, void *post, void *data) |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
396 { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
397 ngx_msec_t *sp = data; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
398 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
399 if (*sp > 16384) { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
400 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
401 "\"quic_max_ack_delay\" must be less than 16384"); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
402 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
403 return NGX_CONF_ERROR; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
404 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
405 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
406 return NGX_CONF_OK; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
407 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
408 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
409 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
410 static char * |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
411 ngx_http_quic_max_udp_payload_size(ngx_conf_t *cf, void *post, void *data) |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
412 { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
413 size_t *sp = data; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
414 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
415 if (*sp < NGX_QUIC_MIN_INITIAL_SIZE |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
416 || *sp > NGX_QUIC_MAX_UDP_PAYLOAD_SIZE) |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
417 { |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
418 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
419 "\"quic_max_udp_payload_size\" must be between " |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
420 "%d and %d", |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
421 NGX_QUIC_MIN_INITIAL_SIZE, |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
422 NGX_QUIC_MAX_UDP_PAYLOAD_SIZE); |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
423 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
424 return NGX_CONF_ERROR; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
425 } |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
426 |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
427 return NGX_CONF_OK; |
0d2b2664b41c
QUIC: added "quic" listen parameter.
Roman Arutyunyan <arut@nginx.com>
parents:
diff
changeset
|
428 } |
8287
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
429 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
430 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
431 static char * |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
432 ngx_http_quic_host_key(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
433 { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
434 ngx_quic_conf_t *qcf = conf; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
435 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
436 u_char *buf; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
437 size_t size; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
438 ssize_t n; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
439 ngx_str_t *value; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
440 ngx_file_t file; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
441 ngx_file_info_t fi; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
442 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
443 if (qcf->host_key.len) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
444 return "is duplicate"; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
445 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
446 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
447 buf = NULL; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
448 #if (NGX_SUPPRESS_WARN) |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
449 size = 0; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
450 #endif |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
451 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
452 value = cf->args->elts; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
453 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
454 if (ngx_conf_full_name(cf->cycle, &value[1], 1) != NGX_OK) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
455 return NGX_CONF_ERROR; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
456 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
457 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
458 ngx_memzero(&file, sizeof(ngx_file_t)); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
459 file.name = value[1]; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
460 file.log = cf->log; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
461 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
462 file.fd = ngx_open_file(file.name.data, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
463 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
464 if (file.fd == NGX_INVALID_FILE) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
465 ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
466 ngx_open_file_n " \"%V\" failed", &file.name); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
467 return NGX_CONF_ERROR; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
468 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
469 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
470 if (ngx_fd_info(file.fd, &fi) == NGX_FILE_ERROR) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
471 ngx_conf_log_error(NGX_LOG_CRIT, cf, ngx_errno, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
472 ngx_fd_info_n " \"%V\" failed", &file.name); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
473 goto failed; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
474 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
475 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
476 size = ngx_file_size(&fi); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
477 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
478 if (size == 0) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
479 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
480 "\"%V\" zero key size", &file.name); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
481 goto failed; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
482 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
483 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
484 buf = ngx_pnalloc(cf->pool, size); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
485 if (buf == NULL) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
486 goto failed; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
487 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
488 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
489 n = ngx_read_file(&file, buf, size, 0); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
490 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
491 if (n == NGX_ERROR) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
492 ngx_conf_log_error(NGX_LOG_CRIT, cf, ngx_errno, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
493 ngx_read_file_n " \"%V\" failed", &file.name); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
494 goto failed; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
495 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
496 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
497 if ((size_t) n != size) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
498 ngx_conf_log_error(NGX_LOG_CRIT, cf, 0, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
499 ngx_read_file_n " \"%V\" returned only " |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
500 "%z bytes instead of %uz", &file.name, n, size); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
501 goto failed; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
502 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
503 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
504 qcf->host_key.data = buf; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
505 qcf->host_key.len = n; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
506 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
507 if (ngx_close_file(file.fd) == NGX_FILE_ERROR) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
508 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
509 ngx_close_file_n " \"%V\" failed", &file.name); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
510 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
511 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
512 return NGX_CONF_OK; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
513 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
514 failed: |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
515 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
516 if (ngx_close_file(file.fd) == NGX_FILE_ERROR) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
517 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
518 ngx_close_file_n " \"%V\" failed", &file.name); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
519 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
520 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
521 if (buf) { |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
522 ngx_explicit_memzero(buf, size); |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
523 } |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
524 |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
525 return NGX_CONF_ERROR; |
cef042935003
QUIC: the "quic_host_key" directive.
Vladimir Homutov <vl@nginx.com>
parents:
8279
diff
changeset
|
526 } |