comparison src/http/v3/ngx_http_v3_module.c @ 8415:125cbfa77013 quic

Renamed max_packet_size to max_udp_payload_size, from draft-28. No functional changes.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 29 May 2020 12:56:08 +0300
parents 7ea34e13937f
children 6633f17044eb
comparison
equal deleted inserted replaced
8414:49a98760afd2 8415:125cbfa77013
9 #include <ngx_core.h> 9 #include <ngx_core.h>
10 #include <ngx_http.h> 10 #include <ngx_http.h>
11 11
12 12
13 static char *ngx_http_v3_max_ack_delay(ngx_conf_t *cf, void *post, void *data); 13 static char *ngx_http_v3_max_ack_delay(ngx_conf_t *cf, void *post, void *data);
14 static char *ngx_http_v3_max_packet_size(ngx_conf_t *cf, void *post, 14 static char *ngx_http_v3_max_udp_payload_size(ngx_conf_t *cf, void *post,
15 void *data); 15 void *data);
16 16
17 17
18 static ngx_conf_post_t ngx_http_v3_max_ack_delay_post = 18 static ngx_conf_post_t ngx_http_v3_max_ack_delay_post =
19 { ngx_http_v3_max_ack_delay }; 19 { ngx_http_v3_max_ack_delay };
20 static ngx_conf_post_t ngx_http_v3_max_packet_size_post = 20 static ngx_conf_post_t ngx_http_v3_max_udp_payload_size_post =
21 { ngx_http_v3_max_packet_size }; 21 { ngx_http_v3_max_udp_payload_size };
22 static ngx_conf_num_bounds_t ngx_http_v3_ack_delay_exponent_bounds = 22 static ngx_conf_num_bounds_t ngx_http_v3_ack_delay_exponent_bounds =
23 { ngx_conf_check_num_bounds, 0, 20 }; 23 { ngx_conf_check_num_bounds, 0, 20 };
24 static ngx_conf_num_bounds_t ngx_http_v3_active_connection_id_limit_bounds = 24 static ngx_conf_num_bounds_t ngx_http_v3_active_connection_id_limit_bounds =
25 { ngx_conf_check_num_bounds, 2, -1 }; 25 { ngx_conf_check_num_bounds, 2, -1 };
26 26
39 ngx_conf_set_msec_slot, 39 ngx_conf_set_msec_slot,
40 NGX_HTTP_SRV_CONF_OFFSET, 40 NGX_HTTP_SRV_CONF_OFFSET,
41 offsetof(ngx_http_v3_srv_conf_t, quic.max_ack_delay), 41 offsetof(ngx_http_v3_srv_conf_t, quic.max_ack_delay),
42 &ngx_http_v3_max_ack_delay_post }, 42 &ngx_http_v3_max_ack_delay_post },
43 43
44 { ngx_string("quic_max_packet_size"), 44 { ngx_string("quic_max_udp_payload_size"),
45 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, 45 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
46 ngx_conf_set_size_slot, 46 ngx_conf_set_size_slot,
47 NGX_HTTP_SRV_CONF_OFFSET, 47 NGX_HTTP_SRV_CONF_OFFSET,
48 offsetof(ngx_http_v3_srv_conf_t, quic.max_packet_size), 48 offsetof(ngx_http_v3_srv_conf_t, quic.max_udp_payload_size),
49 &ngx_http_v3_max_packet_size_post }, 49 &ngx_http_v3_max_udp_payload_size_post },
50 50
51 { ngx_string("quic_initial_max_data"), 51 { ngx_string("quic_initial_max_data"),
52 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, 52 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
53 ngx_conf_set_size_slot, 53 ngx_conf_set_size_slot,
54 NGX_HTTP_SRV_CONF_OFFSET, 54 NGX_HTTP_SRV_CONF_OFFSET,
251 */ 251 */
252 252
253 v3cf->quic.max_idle_timeout = NGX_CONF_UNSET_MSEC; 253 v3cf->quic.max_idle_timeout = NGX_CONF_UNSET_MSEC;
254 v3cf->quic.max_ack_delay = NGX_CONF_UNSET_MSEC; 254 v3cf->quic.max_ack_delay = NGX_CONF_UNSET_MSEC;
255 255
256 v3cf->quic.max_packet_size = NGX_CONF_UNSET_SIZE; 256 v3cf->quic.max_udp_payload_size = NGX_CONF_UNSET_SIZE;
257 v3cf->quic.initial_max_data = NGX_CONF_UNSET_SIZE; 257 v3cf->quic.initial_max_data = NGX_CONF_UNSET_SIZE;
258 v3cf->quic.initial_max_stream_data_bidi_local = NGX_CONF_UNSET_SIZE; 258 v3cf->quic.initial_max_stream_data_bidi_local = NGX_CONF_UNSET_SIZE;
259 v3cf->quic.initial_max_stream_data_bidi_remote = NGX_CONF_UNSET_SIZE; 259 v3cf->quic.initial_max_stream_data_bidi_remote = NGX_CONF_UNSET_SIZE;
260 v3cf->quic.initial_max_stream_data_uni = NGX_CONF_UNSET_SIZE; 260 v3cf->quic.initial_max_stream_data_uni = NGX_CONF_UNSET_SIZE;
261 v3cf->quic.initial_max_streams_bidi = NGX_CONF_UNSET_UINT; 261 v3cf->quic.initial_max_streams_bidi = NGX_CONF_UNSET_UINT;
281 281
282 ngx_conf_merge_msec_value(conf->quic.max_ack_delay, 282 ngx_conf_merge_msec_value(conf->quic.max_ack_delay,
283 prev->quic.max_ack_delay, 283 prev->quic.max_ack_delay,
284 NGX_QUIC_DEFAULT_MAX_ACK_DELAY); 284 NGX_QUIC_DEFAULT_MAX_ACK_DELAY);
285 285
286 ngx_conf_merge_size_value(conf->quic.max_packet_size, 286 ngx_conf_merge_size_value(conf->quic.max_udp_payload_size,
287 prev->quic.max_packet_size, 287 prev->quic.max_udp_payload_size,
288 NGX_QUIC_DEFAULT_MAX_PACKET_SIZE); 288 NGX_QUIC_MAX_UDP_PAYLOAD_SIZE);
289 289
290 ngx_conf_merge_size_value(conf->quic.initial_max_data, 290 ngx_conf_merge_size_value(conf->quic.initial_max_data,
291 prev->quic.initial_max_data, 291 prev->quic.initial_max_data,
292 16 * NGX_QUIC_STREAM_BUFSIZE); 292 16 * NGX_QUIC_STREAM_BUFSIZE);
293 293
347 return NGX_CONF_OK; 347 return NGX_CONF_OK;
348 } 348 }
349 349
350 350
351 static char * 351 static char *
352 ngx_http_v3_max_packet_size(ngx_conf_t *cf, void *post, void *data) 352 ngx_http_v3_max_udp_payload_size(ngx_conf_t *cf, void *post, void *data)
353 { 353 {
354 size_t *sp = data; 354 size_t *sp = data;
355 355
356 if (*sp < NGX_QUIC_MIN_INITIAL_SIZE 356 if (*sp < NGX_QUIC_MIN_INITIAL_SIZE
357 || *sp > NGX_QUIC_DEFAULT_MAX_PACKET_SIZE) 357 || *sp > NGX_QUIC_MAX_UDP_PAYLOAD_SIZE)
358 { 358 {
359 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 359 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
360 "\"quic_max_packet_size\" must be between %d and %d", 360 "\"quic_max_udp_payload_size\" must be between "
361 "%d and %d",
361 NGX_QUIC_MIN_INITIAL_SIZE, 362 NGX_QUIC_MIN_INITIAL_SIZE,
362 NGX_QUIC_DEFAULT_MAX_PACKET_SIZE); 363 NGX_QUIC_MAX_UDP_PAYLOAD_SIZE);
363 364
364 return NGX_CONF_ERROR; 365 return NGX_CONF_ERROR;
365 } 366 }
366 367
367 return NGX_CONF_OK; 368 return NGX_CONF_OK;