annotate src/http/v3/ngx_http_v3_module.c @ 8922:be08b858086a quic

HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro. Listen quic parameter is no longer supported.
author Roman Arutyunyan <arut@nginx.com>
date Sat, 04 Dec 2021 10:52:55 +0300
parents 33226ac61076
children 651cc905b7c2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8215
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
1
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
2 /*
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
3 * Copyright (C) Nginx, Inc.
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
4 * Copyright (C) Roman Arutyunyan
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
5 */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
6
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
7
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
8 #include <ngx_config.h>
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
9 #include <ngx_core.h>
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
10 #include <ngx_http.h>
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
11
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
12
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
13 static ngx_int_t ngx_http_v3_variable_quic(ngx_http_request_t *r,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
14 ngx_http_variable_value_t *v, uintptr_t data);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
15 static ngx_int_t ngx_http_v3_add_variables(ngx_conf_t *cf);
8493
e533a352d118 Style: moved function declarations to match usual code style.
Roman Arutyunyan <arut@nginx.com>
parents: 8492
diff changeset
16 static void *ngx_http_v3_create_srv_conf(ngx_conf_t *cf);
e533a352d118 Style: moved function declarations to match usual code style.
Roman Arutyunyan <arut@nginx.com>
parents: 8492
diff changeset
17 static char *ngx_http_v3_merge_srv_conf(ngx_conf_t *cf, void *parent,
e533a352d118 Style: moved function declarations to match usual code style.
Roman Arutyunyan <arut@nginx.com>
parents: 8492
diff changeset
18 void *child);
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
19 static char *ngx_http_quic_max_ack_delay(ngx_conf_t *cf, void *post,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
20 void *data);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
21 static char *ngx_http_quic_max_udp_payload_size(ngx_conf_t *cf, void *post,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
22 void *data);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
23 static char *ngx_http_quic_host_key(ngx_conf_t *cf, ngx_command_t *cmd,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
24 void *conf);
8497
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
25 static void *ngx_http_v3_create_loc_conf(ngx_conf_t *cf);
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
26 static char *ngx_http_v3_merge_loc_conf(ngx_conf_t *cf, void *parent,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
27 void *child);
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
28 static char *ngx_http_v3_push(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
8493
e533a352d118 Style: moved function declarations to match usual code style.
Roman Arutyunyan <arut@nginx.com>
parents: 8492
diff changeset
29
e533a352d118 Style: moved function declarations to match usual code style.
Roman Arutyunyan <arut@nginx.com>
parents: 8492
diff changeset
30
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
31 static ngx_conf_post_t ngx_http_quic_max_ack_delay_post =
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
32 { ngx_http_quic_max_ack_delay };
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
33 static ngx_conf_post_t ngx_http_quic_max_udp_payload_size_post =
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
34 { ngx_http_quic_max_udp_payload_size };
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
35 static ngx_conf_num_bounds_t ngx_http_quic_ack_delay_exponent_bounds =
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
36 { ngx_conf_check_num_bounds, 0, 20 };
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
37 static ngx_conf_num_bounds_t ngx_http_quic_active_connection_id_limit_bounds =
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
38 { ngx_conf_check_num_bounds, 2, -1 };
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
39
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
40
8215
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
41 static ngx_command_t ngx_http_v3_commands[] = {
8247
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
42
8456
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
43 { ngx_string("http3_max_table_capacity"),
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
44 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
45 ngx_conf_set_size_slot,
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
46 NGX_HTTP_SRV_CONF_OFFSET,
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
47 offsetof(ngx_http_v3_srv_conf_t, max_table_capacity),
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
48 NULL },
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
49
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
50 { ngx_string("http3_max_blocked_streams"),
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
51 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
52 ngx_conf_set_num_slot,
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
53 NGX_HTTP_SRV_CONF_OFFSET,
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
54 offsetof(ngx_http_v3_srv_conf_t, max_blocked_streams),
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
55 NULL },
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
56
8497
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
57 { ngx_string("http3_max_concurrent_pushes"),
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
58 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
59 ngx_conf_set_num_slot,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
60 NGX_HTTP_SRV_CONF_OFFSET,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
61 offsetof(ngx_http_v3_srv_conf_t, max_concurrent_pushes),
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
62 NULL },
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
63
8824
054f9be0aaf9 HTTP/3: http3_max_uni_streams directive.
Roman Arutyunyan <arut@nginx.com>
parents: 8788
diff changeset
64 { ngx_string("http3_max_uni_streams"),
054f9be0aaf9 HTTP/3: http3_max_uni_streams directive.
Roman Arutyunyan <arut@nginx.com>
parents: 8788
diff changeset
65 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
054f9be0aaf9 HTTP/3: http3_max_uni_streams directive.
Roman Arutyunyan <arut@nginx.com>
parents: 8788
diff changeset
66 ngx_conf_set_num_slot,
054f9be0aaf9 HTTP/3: http3_max_uni_streams directive.
Roman Arutyunyan <arut@nginx.com>
parents: 8788
diff changeset
67 NGX_HTTP_SRV_CONF_OFFSET,
054f9be0aaf9 HTTP/3: http3_max_uni_streams directive.
Roman Arutyunyan <arut@nginx.com>
parents: 8788
diff changeset
68 offsetof(ngx_http_v3_srv_conf_t, max_uni_streams),
054f9be0aaf9 HTTP/3: http3_max_uni_streams directive.
Roman Arutyunyan <arut@nginx.com>
parents: 8788
diff changeset
69 NULL },
054f9be0aaf9 HTTP/3: http3_max_uni_streams directive.
Roman Arutyunyan <arut@nginx.com>
parents: 8788
diff changeset
70
8922
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
71 #if (NGX_HTTP_V3_HQ)
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
72 { ngx_string("http3_hq"),
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
73 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
74 ngx_conf_set_flag_slot,
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
75 NGX_HTTP_SRV_CONF_OFFSET,
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
76 offsetof(ngx_http_v3_srv_conf_t, hq),
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
77 NULL },
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
78 #endif
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
79
8497
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
80 { ngx_string("http3_push"),
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
81 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
82 ngx_http_v3_push,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
83 NGX_HTTP_LOC_CONF_OFFSET,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
84 0,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
85 NULL },
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
86
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
87 { ngx_string("http3_push_preload"),
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
88 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
89 ngx_conf_set_flag_slot,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
90 NGX_HTTP_LOC_CONF_OFFSET,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
91 offsetof(ngx_http_v3_loc_conf_t, push_preload),
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
92 NULL },
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
93
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
94 { ngx_string("quic_max_idle_timeout"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
95 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
96 ngx_conf_set_msec_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
97 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
98 offsetof(ngx_http_v3_srv_conf_t, quic.tp.max_idle_timeout),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
99 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
100
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
101 { ngx_string("quic_max_ack_delay"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
102 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
103 ngx_conf_set_msec_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
104 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
105 offsetof(ngx_http_v3_srv_conf_t, quic.tp.max_ack_delay),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
106 &ngx_http_quic_max_ack_delay_post },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
107
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
108 { ngx_string("quic_max_udp_payload_size"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
109 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
110 ngx_conf_set_size_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
111 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
112 offsetof(ngx_http_v3_srv_conf_t, quic.tp.max_udp_payload_size),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
113 &ngx_http_quic_max_udp_payload_size_post },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
114
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
115 { ngx_string("quic_initial_max_data"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
116 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
117 ngx_conf_set_size_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
118 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
119 offsetof(ngx_http_v3_srv_conf_t, quic.tp.initial_max_data),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
120 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
121
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
122 { ngx_string("quic_initial_max_stream_data_bidi_local"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
123 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
124 ngx_conf_set_size_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
125 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
126 offsetof(ngx_http_v3_srv_conf_t,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
127 quic.tp.initial_max_stream_data_bidi_local),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
128 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
129
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
130 { ngx_string("quic_initial_max_stream_data_bidi_remote"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
131 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
132 ngx_conf_set_size_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
133 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
134 offsetof(ngx_http_v3_srv_conf_t,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
135 quic.tp.initial_max_stream_data_bidi_remote),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
136 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
137
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
138 { ngx_string("quic_initial_max_stream_data_uni"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
139 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
140 ngx_conf_set_size_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
141 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
142 offsetof(ngx_http_v3_srv_conf_t, quic.tp.initial_max_stream_data_uni),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
143 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
144
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
145 { ngx_string("quic_initial_max_streams_bidi"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
146 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
147 ngx_conf_set_num_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
148 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
149 offsetof(ngx_http_v3_srv_conf_t, quic.tp.initial_max_streams_bidi),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
150 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
151
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
152 { ngx_string("quic_initial_max_streams_uni"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
153 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
154 ngx_conf_set_num_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
155 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
156 offsetof(ngx_http_v3_srv_conf_t, quic.tp.initial_max_streams_uni),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
157 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
158
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
159 { ngx_string("quic_ack_delay_exponent"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
160 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
161 ngx_conf_set_num_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
162 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
163 offsetof(ngx_http_v3_srv_conf_t, quic.tp.ack_delay_exponent),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
164 &ngx_http_quic_ack_delay_exponent_bounds },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
165
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
166 { ngx_string("quic_disable_active_migration"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
167 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
168 ngx_conf_set_flag_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
169 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
170 offsetof(ngx_http_v3_srv_conf_t, quic.tp.disable_active_migration),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
171 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
172
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
173 { ngx_string("quic_active_connection_id_limit"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
174 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
175 ngx_conf_set_num_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
176 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
177 offsetof(ngx_http_v3_srv_conf_t, quic.tp.active_connection_id_limit),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
178 &ngx_http_quic_active_connection_id_limit_bounds },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
179
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
180 { ngx_string("quic_retry"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
181 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
182 ngx_conf_set_flag_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
183 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
184 offsetof(ngx_http_v3_srv_conf_t, quic.retry),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
185 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
186
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
187 { ngx_string("quic_gso"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
188 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
189 ngx_conf_set_flag_slot,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
190 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
191 offsetof(ngx_http_v3_srv_conf_t, quic.gso_enabled),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
192 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
193
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
194 { ngx_string("quic_host_key"),
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
195 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
196 ngx_http_quic_host_key,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
197 NGX_HTTP_SRV_CONF_OFFSET,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
198 0,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
199 NULL },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
200
8215
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
201 ngx_null_command
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
202 };
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
203
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
204
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
205 static ngx_http_module_t ngx_http_v3_module_ctx = {
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
206 ngx_http_v3_add_variables, /* preconfiguration */
8215
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
207 NULL, /* postconfiguration */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
208
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
209 NULL, /* create main configuration */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
210 NULL, /* init main configuration */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
211
8247
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
212 ngx_http_v3_create_srv_conf, /* create server configuration */
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
213 ngx_http_v3_merge_srv_conf, /* merge server configuration */
8215
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
214
8497
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
215 ngx_http_v3_create_loc_conf, /* create location configuration */
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
216 ngx_http_v3_merge_loc_conf /* merge location configuration */
8215
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
217 };
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
218
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
219
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
220 ngx_module_t ngx_http_v3_module = {
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
221 NGX_MODULE_V1,
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
222 &ngx_http_v3_module_ctx, /* module context */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
223 ngx_http_v3_commands, /* module directives */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
224 NGX_HTTP_MODULE, /* module type */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
225 NULL, /* init master */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
226 NULL, /* init module */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
227 NULL, /* init process */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
228 NULL, /* init thread */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
229 NULL, /* exit thread */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
230 NULL, /* exit process */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
231 NULL, /* exit master */
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
232 NGX_MODULE_V1_PADDING
38c0898b6df7 HTTP/3.
Roman Arutyunyan <arut@nginx.com>
parents:
diff changeset
233 };
8247
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
234
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
235
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
236 static ngx_http_variable_t ngx_http_v3_vars[] = {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
237
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
238 { ngx_string("quic"), NULL, ngx_http_v3_variable_quic, 0, 0, 0 },
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
239
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
240 ngx_http_null_variable
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
241 };
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
242
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
243 static ngx_str_t ngx_http_quic_salt = ngx_string("ngx_quic");
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
244
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
245
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
246 static ngx_int_t
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
247 ngx_http_v3_variable_quic(ngx_http_request_t *r,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
248 ngx_http_variable_value_t *v, uintptr_t data)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
249 {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
250 if (r->connection->quic) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
251
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
252 v->len = 4;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
253 v->valid = 1;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
254 v->no_cacheable = 1;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
255 v->not_found = 0;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
256 v->data = (u_char *) "quic";
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
257 return NGX_OK;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
258 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
259
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
260 v->not_found = 1;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
261
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
262 return NGX_OK;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
263 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
264
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
265
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
266 static ngx_int_t
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
267 ngx_http_v3_add_variables(ngx_conf_t *cf)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
268 {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
269 ngx_http_variable_t *var, *v;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
270
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
271 for (v = ngx_http_v3_vars; v->name.len; v++) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
272 var = ngx_http_add_variable(cf, &v->name, v->flags);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
273 if (var == NULL) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
274 return NGX_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
275 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
276
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
277 var->get_handler = v->get_handler;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
278 var->data = v->data;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
279 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
280
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
281 return NGX_OK;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
282 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
283
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
284
8247
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
285 static void *
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
286 ngx_http_v3_create_srv_conf(ngx_conf_t *cf)
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
287 {
8492
65c1fc5fae15 HTTP/3: renamed server configuration variables from v3cf to h3scf.
Roman Arutyunyan <arut@nginx.com>
parents: 8481
diff changeset
288 ngx_http_v3_srv_conf_t *h3scf;
8247
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
289
8492
65c1fc5fae15 HTTP/3: renamed server configuration variables from v3cf to h3scf.
Roman Arutyunyan <arut@nginx.com>
parents: 8481
diff changeset
290 h3scf = ngx_pcalloc(cf->pool, sizeof(ngx_http_v3_srv_conf_t));
65c1fc5fae15 HTTP/3: renamed server configuration variables from v3cf to h3scf.
Roman Arutyunyan <arut@nginx.com>
parents: 8481
diff changeset
291 if (h3scf == NULL) {
8247
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
292 return NULL;
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
293 }
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
294
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
295 /*
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
296 * set by ngx_pcalloc():
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
297 *
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
298 * h3scf->quic.tp.original_dcid = { 0, NULL };
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
299 * h3scf->quic.tp.initial_scid = { 0, NULL };
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
300 * h3scf->quic.tp.retry_scid = { 0, NULL };
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
301 * h3scf->quic.tp.sr_token = { 0 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
302 * h3scf->quic.tp.sr_enabled = 0
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
303 * h3scf->quic.tp.preferred_address = NULL
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
304 * h3scf->quic.host_key = { 0, NULL }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
305 * h3scf->quic.stream_reject_code_uni = 0;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
306 */
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
307
8492
65c1fc5fae15 HTTP/3: renamed server configuration variables from v3cf to h3scf.
Roman Arutyunyan <arut@nginx.com>
parents: 8481
diff changeset
308 h3scf->max_table_capacity = NGX_CONF_UNSET_SIZE;
65c1fc5fae15 HTTP/3: renamed server configuration variables from v3cf to h3scf.
Roman Arutyunyan <arut@nginx.com>
parents: 8481
diff changeset
309 h3scf->max_blocked_streams = NGX_CONF_UNSET_UINT;
8497
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
310 h3scf->max_concurrent_pushes = NGX_CONF_UNSET_UINT;
8824
054f9be0aaf9 HTTP/3: http3_max_uni_streams directive.
Roman Arutyunyan <arut@nginx.com>
parents: 8788
diff changeset
311 h3scf->max_uni_streams = NGX_CONF_UNSET_UINT;
8922
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
312 #if (NGX_HTTP_V3_HQ)
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
313 h3scf->hq = NGX_CONF_UNSET;
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
314 #endif
8454
032cb35ce758 HTTP/3: http3_max_field_size directive to limit string size.
Roman Arutyunyan <arut@nginx.com>
parents: 8417
diff changeset
315
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
316 h3scf->quic.tp.max_idle_timeout = NGX_CONF_UNSET_MSEC;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
317 h3scf->quic.tp.max_ack_delay = NGX_CONF_UNSET_MSEC;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
318 h3scf->quic.tp.max_udp_payload_size = NGX_CONF_UNSET_SIZE;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
319 h3scf->quic.tp.initial_max_data = NGX_CONF_UNSET_SIZE;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
320 h3scf->quic.tp.initial_max_stream_data_bidi_local = NGX_CONF_UNSET_SIZE;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
321 h3scf->quic.tp.initial_max_stream_data_bidi_remote = NGX_CONF_UNSET_SIZE;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
322 h3scf->quic.tp.initial_max_stream_data_uni = NGX_CONF_UNSET_SIZE;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
323 h3scf->quic.tp.initial_max_streams_bidi = NGX_CONF_UNSET_UINT;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
324 h3scf->quic.tp.initial_max_streams_uni = NGX_CONF_UNSET_UINT;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
325 h3scf->quic.tp.ack_delay_exponent = NGX_CONF_UNSET_UINT;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
326 h3scf->quic.tp.disable_active_migration = NGX_CONF_UNSET;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
327 h3scf->quic.tp.active_connection_id_limit = NGX_CONF_UNSET_UINT;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
328
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
329 h3scf->quic.retry = NGX_CONF_UNSET;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
330 h3scf->quic.gso_enabled = NGX_CONF_UNSET;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
331 h3scf->quic.stream_close_code = NGX_HTTP_V3_ERR_NO_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
332 h3scf->quic.stream_reject_code_bidi = NGX_HTTP_V3_ERR_REQUEST_REJECTED;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
333
8492
65c1fc5fae15 HTTP/3: renamed server configuration variables from v3cf to h3scf.
Roman Arutyunyan <arut@nginx.com>
parents: 8481
diff changeset
334 return h3scf;
8247
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
335 }
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
336
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
337
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
338 static char *
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
339 ngx_http_v3_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
340 {
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
341 ngx_http_v3_srv_conf_t *prev = parent;
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
342 ngx_http_v3_srv_conf_t *conf = child;
e9891e8ee975 Configurable transport parameters.
Vladimir Homutov <vl@nginx.com>
parents: 8215
diff changeset
343
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
344 ngx_http_ssl_srv_conf_t *sscf;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
345
8456
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
346 ngx_conf_merge_size_value(conf->max_table_capacity,
8829
4f922f611135 HTTP/3: replaced macros with values.
Roman Arutyunyan <arut@nginx.com>
parents: 8824
diff changeset
347 prev->max_table_capacity, 16384);
8456
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
348
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
349 ngx_conf_merge_uint_value(conf->max_blocked_streams,
8829
4f922f611135 HTTP/3: replaced macros with values.
Roman Arutyunyan <arut@nginx.com>
parents: 8824
diff changeset
350 prev->max_blocked_streams, 16);
8456
c9538aef3211 HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents: 8454
diff changeset
351
8497
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
352 ngx_conf_merge_uint_value(conf->max_concurrent_pushes,
8829
4f922f611135 HTTP/3: replaced macros with values.
Roman Arutyunyan <arut@nginx.com>
parents: 8824
diff changeset
353 prev->max_concurrent_pushes, 10);
8497
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
354
8824
054f9be0aaf9 HTTP/3: http3_max_uni_streams directive.
Roman Arutyunyan <arut@nginx.com>
parents: 8788
diff changeset
355 ngx_conf_merge_uint_value(conf->max_uni_streams,
8829
4f922f611135 HTTP/3: replaced macros with values.
Roman Arutyunyan <arut@nginx.com>
parents: 8824
diff changeset
356 prev->max_uni_streams, 3);
8824
054f9be0aaf9 HTTP/3: http3_max_uni_streams directive.
Roman Arutyunyan <arut@nginx.com>
parents: 8788
diff changeset
357
8922
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
358 #if (NGX_HTTP_V3_HQ)
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
359 ngx_conf_merge_value(conf->hq, prev->hq, 0);
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
360 #endif
be08b858086a HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.
Roman Arutyunyan <arut@nginx.com>
parents: 8921
diff changeset
361
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
362 ngx_conf_merge_msec_value(conf->quic.tp.max_idle_timeout,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
363 prev->quic.tp.max_idle_timeout, 60000);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
364
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
365 ngx_conf_merge_msec_value(conf->quic.tp.max_ack_delay,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
366 prev->quic.tp.max_ack_delay,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
367 NGX_QUIC_DEFAULT_MAX_ACK_DELAY);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
368
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
369 ngx_conf_merge_size_value(conf->quic.tp.max_udp_payload_size,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
370 prev->quic.tp.max_udp_payload_size,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
371 NGX_QUIC_MAX_UDP_PAYLOAD_SIZE);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
372
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
373 ngx_conf_merge_size_value(conf->quic.tp.initial_max_data,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
374 prev->quic.tp.initial_max_data,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
375 16 * NGX_QUIC_STREAM_BUFSIZE);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
376
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
377 ngx_conf_merge_size_value(conf->quic.tp.initial_max_stream_data_bidi_local,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
378 prev->quic.tp.initial_max_stream_data_bidi_local,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
379 NGX_QUIC_STREAM_BUFSIZE);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
380
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
381 ngx_conf_merge_size_value(conf->quic.tp.initial_max_stream_data_bidi_remote,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
382 prev->quic.tp.initial_max_stream_data_bidi_remote,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
383 NGX_QUIC_STREAM_BUFSIZE);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
384
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
385 ngx_conf_merge_size_value(conf->quic.tp.initial_max_stream_data_uni,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
386 prev->quic.tp.initial_max_stream_data_uni,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
387 NGX_QUIC_STREAM_BUFSIZE);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
388
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
389 ngx_conf_merge_uint_value(conf->quic.tp.initial_max_streams_bidi,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
390 prev->quic.tp.initial_max_streams_bidi, 16);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
391
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
392 ngx_conf_merge_uint_value(conf->quic.tp.initial_max_streams_uni,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
393 prev->quic.tp.initial_max_streams_uni, 3);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
394
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
395 ngx_conf_merge_uint_value(conf->quic.tp.ack_delay_exponent,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
396 prev->quic.tp.ack_delay_exponent,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
397 NGX_QUIC_DEFAULT_ACK_DELAY_EXPONENT);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
398
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
399 ngx_conf_merge_value(conf->quic.tp.disable_active_migration,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
400 prev->quic.tp.disable_active_migration, 0);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
401
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
402 ngx_conf_merge_uint_value(conf->quic.tp.active_connection_id_limit,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
403 prev->quic.tp.active_connection_id_limit, 2);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
404
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
405 ngx_conf_merge_value(conf->quic.retry, prev->quic.retry, 0);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
406 ngx_conf_merge_value(conf->quic.gso_enabled, prev->quic.gso_enabled, 0);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
407
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
408 ngx_conf_merge_str_value(conf->quic.host_key, prev->quic.host_key, "");
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
409
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
410 if (conf->quic.host_key.len == 0) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
411
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
412 conf->quic.host_key.len = NGX_QUIC_DEFAULT_HOST_KEY_LEN;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
413 conf->quic.host_key.data = ngx_palloc(cf->pool,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
414 conf->quic.host_key.len);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
415 if (conf->quic.host_key.data == NULL) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
416 return NGX_CONF_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
417 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
418
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
419 if (RAND_bytes(conf->quic.host_key.data, NGX_QUIC_DEFAULT_HOST_KEY_LEN)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
420 <= 0)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
421 {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
422 return NGX_CONF_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
423 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
424 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
425
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
426 if (ngx_quic_derive_key(cf->log, "av_token_key",
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
427 &conf->quic.host_key, &ngx_http_quic_salt,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
428 conf->quic.av_token_key, NGX_QUIC_AV_KEY_LEN)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
429 != NGX_OK)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
430 {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
431 return NGX_CONF_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
432 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
433
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
434 if (ngx_quic_derive_key(cf->log, "sr_token_key",
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
435 &conf->quic.host_key, &ngx_http_quic_salt,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
436 conf->quic.sr_token_key, NGX_QUIC_SR_KEY_LEN)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
437 != NGX_OK)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
438 {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
439 return NGX_CONF_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
440 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
441
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
442 sscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_ssl_module);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
443 conf->quic.ssl = &sscf->ssl;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
444
8497
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
445 return NGX_CONF_OK;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
446 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
447
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
448
8921
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
449 static char *
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
450 ngx_http_quic_max_ack_delay(ngx_conf_t *cf, void *post, void *data)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
451 {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
452 ngx_msec_t *sp = data;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
453
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
454 if (*sp >= 16384) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
455 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
456 "\"quic_max_ack_delay\" must be less than 16384");
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
457
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
458 return NGX_CONF_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
459 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
460
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
461 return NGX_CONF_OK;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
462 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
463
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
464
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
465 static char *
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
466 ngx_http_quic_max_udp_payload_size(ngx_conf_t *cf, void *post, void *data)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
467 {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
468 size_t *sp = data;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
469
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
470 if (*sp < NGX_QUIC_MIN_INITIAL_SIZE
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
471 || *sp > NGX_QUIC_MAX_UDP_PAYLOAD_SIZE)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
472 {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
473 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
474 "\"quic_max_udp_payload_size\" must be between "
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
475 "%d and %d",
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
476 NGX_QUIC_MIN_INITIAL_SIZE,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
477 NGX_QUIC_MAX_UDP_PAYLOAD_SIZE);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
478
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
479 return NGX_CONF_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
480 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
481
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
482 return NGX_CONF_OK;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
483 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
484
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
485
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
486 static char *
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
487 ngx_http_quic_host_key(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
488 {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
489 ngx_http_v3_srv_conf_t *h3scf = conf;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
490
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
491 u_char *buf;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
492 size_t size;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
493 ssize_t n;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
494 ngx_str_t *value;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
495 ngx_file_t file;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
496 ngx_file_info_t fi;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
497 ngx_quic_conf_t *qcf;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
498
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
499 qcf = &h3scf->quic;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
500
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
501 if (qcf->host_key.len) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
502 return "is duplicate";
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
503 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
504
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
505 buf = NULL;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
506 #if (NGX_SUPPRESS_WARN)
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
507 size = 0;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
508 #endif
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
509
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
510 value = cf->args->elts;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
511
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
512 if (ngx_conf_full_name(cf->cycle, &value[1], 1) != NGX_OK) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
513 return NGX_CONF_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
514 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
515
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
516 ngx_memzero(&file, sizeof(ngx_file_t));
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
517 file.name = value[1];
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
518 file.log = cf->log;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
519
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
520 file.fd = ngx_open_file(file.name.data, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
521
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
522 if (file.fd == NGX_INVALID_FILE) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
523 ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
524 ngx_open_file_n " \"%V\" failed", &file.name);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
525 return NGX_CONF_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
526 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
527
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
528 if (ngx_fd_info(file.fd, &fi) == NGX_FILE_ERROR) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
529 ngx_conf_log_error(NGX_LOG_CRIT, cf, ngx_errno,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
530 ngx_fd_info_n " \"%V\" failed", &file.name);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
531 goto failed;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
532 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
533
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
534 size = ngx_file_size(&fi);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
535
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
536 if (size == 0) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
537 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
538 "\"%V\" zero key size", &file.name);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
539 goto failed;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
540 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
541
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
542 buf = ngx_pnalloc(cf->pool, size);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
543 if (buf == NULL) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
544 goto failed;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
545 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
546
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
547 n = ngx_read_file(&file, buf, size, 0);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
548
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
549 if (n == NGX_ERROR) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
550 ngx_conf_log_error(NGX_LOG_CRIT, cf, ngx_errno,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
551 ngx_read_file_n " \"%V\" failed", &file.name);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
552 goto failed;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
553 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
554
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
555 if ((size_t) n != size) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
556 ngx_conf_log_error(NGX_LOG_CRIT, cf, 0,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
557 ngx_read_file_n " \"%V\" returned only "
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
558 "%z bytes instead of %uz", &file.name, n, size);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
559 goto failed;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
560 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
561
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
562 qcf->host_key.data = buf;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
563 qcf->host_key.len = n;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
564
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
565 if (ngx_close_file(file.fd) == NGX_FILE_ERROR) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
566 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
567 ngx_close_file_n " \"%V\" failed", &file.name);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
568 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
569
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
570 return NGX_CONF_OK;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
571
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
572 failed:
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
573
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
574 if (ngx_close_file(file.fd) == NGX_FILE_ERROR) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
575 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
576 ngx_close_file_n " \"%V\" failed", &file.name);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
577 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
578
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
579 if (buf) {
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
580 ngx_explicit_memzero(buf, size);
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
581 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
582
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
583 return NGX_CONF_ERROR;
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
584 }
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
585
33226ac61076 HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
Roman Arutyunyan <arut@nginx.com>
parents: 8829
diff changeset
586
8497
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
587 static void *
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
588 ngx_http_v3_create_loc_conf(ngx_conf_t *cf)
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
589 {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
590 ngx_http_v3_loc_conf_t *h3lcf;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
591
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
592 h3lcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_v3_loc_conf_t));
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
593 if (h3lcf == NULL) {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
594 return NULL;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
595 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
596
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
597 /*
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
598 * set by ngx_pcalloc():
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
599 *
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
600 * h3lcf->pushes = NULL;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
601 */
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
602
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
603 h3lcf->push_preload = NGX_CONF_UNSET;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
604 h3lcf->push = NGX_CONF_UNSET;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
605
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
606 return h3lcf;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
607 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
608
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
609
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
610 static char *
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
611 ngx_http_v3_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
612 {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
613 ngx_http_v3_loc_conf_t *prev = parent;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
614 ngx_http_v3_loc_conf_t *conf = child;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
615
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
616 ngx_conf_merge_value(conf->push, prev->push, 1);
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
617
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
618 if (conf->push && conf->pushes == NULL) {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
619 conf->pushes = prev->pushes;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
620 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
621
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
622 ngx_conf_merge_value(conf->push_preload, prev->push_preload, 0);
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
623
8353
036164360fa9 HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8352
diff changeset
624 return NGX_CONF_OK;
036164360fa9 HTTP/3: directives with limited values converted to post handler.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8352
diff changeset
625 }
8497
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
626
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
627
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
628 static char *
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
629 ngx_http_v3_push(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
630 {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
631 ngx_http_v3_loc_conf_t *h3lcf = conf;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
632
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
633 ngx_str_t *value;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
634 ngx_http_complex_value_t *cv;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
635 ngx_http_compile_complex_value_t ccv;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
636
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
637 value = cf->args->elts;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
638
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
639 if (ngx_strcmp(value[1].data, "off") == 0) {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
640
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
641 if (h3lcf->pushes) {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
642 return "\"off\" parameter cannot be used with URI";
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
643 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
644
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
645 if (h3lcf->push == 0) {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
646 return "is duplicate";
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
647 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
648
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
649 h3lcf->push = 0;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
650 return NGX_CONF_OK;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
651 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
652
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
653 if (h3lcf->push == 0) {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
654 return "URI cannot be used with \"off\" parameter";
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
655 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
656
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
657 h3lcf->push = 1;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
658
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
659 if (h3lcf->pushes == NULL) {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
660 h3lcf->pushes = ngx_array_create(cf->pool, 1,
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
661 sizeof(ngx_http_complex_value_t));
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
662 if (h3lcf->pushes == NULL) {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
663 return NGX_CONF_ERROR;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
664 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
665 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
666
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
667 cv = ngx_array_push(h3lcf->pushes);
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
668 if (cv == NULL) {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
669 return NGX_CONF_ERROR;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
670 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
671
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
672 ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
673
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
674 ccv.cf = cf;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
675 ccv.value = &value[1];
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
676 ccv.complex_value = cv;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
677
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
678 if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
679 return NGX_CONF_ERROR;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
680 }
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
681
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
682 return NGX_CONF_OK;
0596fe1aee16 HTTP/3: server pushes.
Roman Arutyunyan <arut@nginx.com>
parents: 8493
diff changeset
683 }