comparison src/stream/ngx_stream_quic_module.c @ 8563:bed310672f39 quic

QUIC: moved ssl configuration pointer to quic configuration. The ssl configuration is obtained at config time and saved for future use.
author Vladimir Homutov <vl@nginx.com>
date Thu, 01 Oct 2020 10:04:35 +0300
parents 893b3313f53c
children 45db1b5c1706
comparison
equal deleted inserted replaced
8562:b31c02454539 8563:bed310672f39
26 { ngx_stream_quic_max_ack_delay }; 26 { ngx_stream_quic_max_ack_delay };
27 static ngx_conf_post_t ngx_stream_quic_max_udp_payload_size_post = 27 static ngx_conf_post_t ngx_stream_quic_max_udp_payload_size_post =
28 { ngx_stream_quic_max_udp_payload_size }; 28 { ngx_stream_quic_max_udp_payload_size };
29 static ngx_conf_num_bounds_t ngx_stream_quic_ack_delay_exponent_bounds = 29 static ngx_conf_num_bounds_t ngx_stream_quic_ack_delay_exponent_bounds =
30 { ngx_conf_check_num_bounds, 0, 20 }; 30 { ngx_conf_check_num_bounds, 0, 20 };
31 static ngx_conf_num_bounds_t 31 static ngx_conf_num_bounds_t
32 ngx_stream_quic_active_connection_id_limit_bounds = 32 ngx_stream_quic_active_connection_id_limit_bounds =
33 { ngx_conf_check_num_bounds, 2, -1 }; 33 { ngx_conf_check_num_bounds, 2, -1 };
34 34
35 35
36 static ngx_command_t ngx_stream_quic_commands[] = { 36 static ngx_command_t ngx_stream_quic_commands[] = {
249 ngx_stream_quic_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child) 249 ngx_stream_quic_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
250 { 250 {
251 ngx_quic_conf_t *prev = parent; 251 ngx_quic_conf_t *prev = parent;
252 ngx_quic_conf_t *conf = child; 252 ngx_quic_conf_t *conf = child;
253 253
254 ngx_stream_ssl_conf_t *scf;
255
254 ngx_conf_merge_msec_value(conf->tp.max_idle_timeout, 256 ngx_conf_merge_msec_value(conf->tp.max_idle_timeout,
255 prev->tp.max_idle_timeout, 60000); 257 prev->tp.max_idle_timeout, 60000);
256 258
257 ngx_conf_merge_msec_value(conf->tp.max_ack_delay, 259 ngx_conf_merge_msec_value(conf->tp.max_ack_delay,
258 prev->tp.max_ack_delay, 260 prev->tp.max_ack_delay,
299 if (conf->retry) { 301 if (conf->retry) {
300 if (RAND_bytes(conf->token_key, sizeof(conf->token_key)) <= 0) { 302 if (RAND_bytes(conf->token_key, sizeof(conf->token_key)) <= 0) {
301 return NGX_CONF_ERROR; 303 return NGX_CONF_ERROR;
302 } 304 }
303 } 305 }
306
307 scf = ngx_stream_conf_get_module_srv_conf(cf, ngx_stream_ssl_module);
308 conf->ssl = &scf->ssl;
304 309
305 return NGX_CONF_OK; 310 return NGX_CONF_OK;
306 } 311 }
307 312
308 313