comparison src/http/v3/ngx_http_v3_module.c @ 8352:d73516830236 quic

HTTP/3: bytes holding directives changed to ngx_conf_set_size_slot. This allows to specify directive values with measurement units.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 22 Apr 2020 15:48:39 +0300
parents a8fc0ab54cea
children 036164360fa9
comparison
equal deleted inserted replaced
8351:dd84c9cef75b 8352:d73516830236
26 offsetof(ngx_http_v3_srv_conf_t, quic.max_ack_delay), 26 offsetof(ngx_http_v3_srv_conf_t, quic.max_ack_delay),
27 NULL }, 27 NULL },
28 28
29 { ngx_string("quic_max_packet_size"), 29 { ngx_string("quic_max_packet_size"),
30 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, 30 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
31 ngx_conf_set_num_slot, 31 ngx_conf_set_size_slot,
32 NGX_HTTP_SRV_CONF_OFFSET, 32 NGX_HTTP_SRV_CONF_OFFSET,
33 offsetof(ngx_http_v3_srv_conf_t, quic.max_packet_size), 33 offsetof(ngx_http_v3_srv_conf_t, quic.max_packet_size),
34 NULL }, 34 NULL },
35 35
36 { ngx_string("quic_initial_max_data"), 36 { ngx_string("quic_initial_max_data"),
37 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, 37 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
38 ngx_conf_set_num_slot, 38 ngx_conf_set_size_slot,
39 NGX_HTTP_SRV_CONF_OFFSET, 39 NGX_HTTP_SRV_CONF_OFFSET,
40 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_data), 40 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_data),
41 NULL }, 41 NULL },
42 42
43 { ngx_string("quic_initial_max_stream_data_bidi_local"), 43 { ngx_string("quic_initial_max_stream_data_bidi_local"),
44 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, 44 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
45 ngx_conf_set_num_slot, 45 ngx_conf_set_size_slot,
46 NGX_HTTP_SRV_CONF_OFFSET, 46 NGX_HTTP_SRV_CONF_OFFSET,
47 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_stream_data_bidi_local), 47 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_stream_data_bidi_local),
48 NULL }, 48 NULL },
49 49
50 { ngx_string("quic_initial_max_stream_data_bidi_remote"), 50 { ngx_string("quic_initial_max_stream_data_bidi_remote"),
51 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, 51 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
52 ngx_conf_set_num_slot, 52 ngx_conf_set_size_slot,
53 NGX_HTTP_SRV_CONF_OFFSET, 53 NGX_HTTP_SRV_CONF_OFFSET,
54 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_stream_data_bidi_remote), 54 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_stream_data_bidi_remote),
55 NULL }, 55 NULL },
56 56
57 { ngx_string("quic_initial_max_stream_data_uni"), 57 { ngx_string("quic_initial_max_stream_data_uni"),
58 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, 58 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
59 ngx_conf_set_num_slot, 59 ngx_conf_set_size_slot,
60 NGX_HTTP_SRV_CONF_OFFSET, 60 NGX_HTTP_SRV_CONF_OFFSET,
61 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_stream_data_uni), 61 offsetof(ngx_http_v3_srv_conf_t, quic.initial_max_stream_data_uni),
62 NULL }, 62 NULL },
63 63
64 { ngx_string("quic_initial_max_streams_bidi"), 64 { ngx_string("quic_initial_max_streams_bidi"),
229 */ 229 */
230 230
231 v3cf->quic.max_idle_timeout = NGX_CONF_UNSET_MSEC; 231 v3cf->quic.max_idle_timeout = NGX_CONF_UNSET_MSEC;
232 v3cf->quic.max_ack_delay = NGX_CONF_UNSET_MSEC; 232 v3cf->quic.max_ack_delay = NGX_CONF_UNSET_MSEC;
233 233
234 v3cf->quic.max_packet_size = NGX_CONF_UNSET_UINT; 234 v3cf->quic.max_packet_size = NGX_CONF_UNSET_SIZE;
235 v3cf->quic.initial_max_data = NGX_CONF_UNSET_UINT; 235 v3cf->quic.initial_max_data = NGX_CONF_UNSET_SIZE;
236 v3cf->quic.initial_max_stream_data_bidi_local = NGX_CONF_UNSET_UINT; 236 v3cf->quic.initial_max_stream_data_bidi_local = NGX_CONF_UNSET_SIZE;
237 v3cf->quic.initial_max_stream_data_bidi_remote = NGX_CONF_UNSET_UINT; 237 v3cf->quic.initial_max_stream_data_bidi_remote = NGX_CONF_UNSET_SIZE;
238 v3cf->quic.initial_max_stream_data_uni = NGX_CONF_UNSET_UINT; 238 v3cf->quic.initial_max_stream_data_uni = NGX_CONF_UNSET_SIZE;
239 v3cf->quic.initial_max_streams_bidi = NGX_CONF_UNSET_UINT; 239 v3cf->quic.initial_max_streams_bidi = NGX_CONF_UNSET_UINT;
240 v3cf->quic.initial_max_streams_uni = NGX_CONF_UNSET_UINT; 240 v3cf->quic.initial_max_streams_uni = NGX_CONF_UNSET_UINT;
241 v3cf->quic.ack_delay_exponent = NGX_CONF_UNSET_UINT; 241 v3cf->quic.ack_delay_exponent = NGX_CONF_UNSET_UINT;
242 v3cf->quic.disable_active_migration = NGX_CONF_UNSET_UINT; 242 v3cf->quic.disable_active_migration = NGX_CONF_UNSET_UINT;
243 v3cf->quic.active_connection_id_limit = NGX_CONF_UNSET_UINT; 243 v3cf->quic.active_connection_id_limit = NGX_CONF_UNSET_UINT;
264 "\"quic_max_ack_delay\" greater than" 264 "\"quic_max_ack_delay\" greater than"
265 " 16384 is invalid"); 265 " 16384 is invalid");
266 return NGX_CONF_ERROR; 266 return NGX_CONF_ERROR;
267 } 267 }
268 268
269 ngx_conf_merge_uint_value(conf->quic.max_packet_size, 269 ngx_conf_merge_size_value(conf->quic.max_packet_size,
270 prev->quic.max_packet_size, 270 prev->quic.max_packet_size,
271 NGX_QUIC_DEFAULT_MAX_PACKET_SIZE); 271 NGX_QUIC_DEFAULT_MAX_PACKET_SIZE);
272 272
273 if (conf->quic.max_packet_size < 1200 273 if (conf->quic.max_packet_size < 1200
274 || conf->quic.max_packet_size > 65527) 274 || conf->quic.max_packet_size > 65527)
277 "\"quic_max_packet_size\" less than" 277 "\"quic_max_packet_size\" less than"
278 " 1200 or greater than 65527 is invalid"); 278 " 1200 or greater than 65527 is invalid");
279 return NGX_CONF_ERROR; 279 return NGX_CONF_ERROR;
280 } 280 }
281 281
282 ngx_conf_merge_uint_value(conf->quic.initial_max_data, 282 ngx_conf_merge_size_value(conf->quic.initial_max_data,
283 prev->quic.initial_max_data, 283 prev->quic.initial_max_data,
284 16 * NGX_QUIC_STREAM_BUFSIZE); 284 16 * NGX_QUIC_STREAM_BUFSIZE);
285 285
286 ngx_conf_merge_uint_value(conf->quic.initial_max_stream_data_bidi_local, 286 ngx_conf_merge_size_value(conf->quic.initial_max_stream_data_bidi_local,
287 prev->quic.initial_max_stream_data_bidi_local, 287 prev->quic.initial_max_stream_data_bidi_local,
288 NGX_QUIC_STREAM_BUFSIZE); 288 NGX_QUIC_STREAM_BUFSIZE);
289 289
290 ngx_conf_merge_uint_value(conf->quic.initial_max_stream_data_bidi_remote, 290 ngx_conf_merge_size_value(conf->quic.initial_max_stream_data_bidi_remote,
291 prev->quic.initial_max_stream_data_bidi_remote, 291 prev->quic.initial_max_stream_data_bidi_remote,
292 NGX_QUIC_STREAM_BUFSIZE); 292 NGX_QUIC_STREAM_BUFSIZE);
293 293
294 ngx_conf_merge_uint_value(conf->quic.initial_max_stream_data_uni, 294 ngx_conf_merge_size_value(conf->quic.initial_max_stream_data_uni,
295 prev->quic.initial_max_stream_data_uni, 295 prev->quic.initial_max_stream_data_uni,
296 NGX_QUIC_STREAM_BUFSIZE); 296 NGX_QUIC_STREAM_BUFSIZE);
297 297
298 ngx_conf_merge_uint_value(conf->quic.initial_max_streams_bidi, 298 ngx_conf_merge_uint_value(conf->quic.initial_max_streams_bidi,
299 prev->quic.initial_max_streams_bidi, 16); 299 prev->quic.initial_max_streams_bidi, 16);