From 0f843cfb74dd4dab7bff4d9a0f7e73b8b8cb61f0 Mon Sep 17 00:00:00 2001 From: Vladimir Homutov Date: Thu, 1 Oct 2020 10:04:35 +0300 Subject: QUIC: moved ssl configuration pointer to quic configuration. The ssl configuration is obtained at config time and saved for future use. --- src/http/modules/ngx_http_quic_module.c | 5 +++++ src/http/ngx_http_request.c | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/http') diff --git a/src/http/modules/ngx_http_quic_module.c b/src/http/modules/ngx_http_quic_module.c index ec70c7286..34898984a 100644 --- a/src/http/modules/ngx_http_quic_module.c +++ b/src/http/modules/ngx_http_quic_module.c @@ -262,6 +262,8 @@ ngx_http_quic_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child) ngx_quic_conf_t *prev = parent; ngx_quic_conf_t *conf = child; + ngx_http_ssl_srv_conf_t *sscf; + ngx_conf_merge_msec_value(conf->tp.max_idle_timeout, prev->tp.max_idle_timeout, 60000); @@ -315,6 +317,9 @@ ngx_http_quic_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child) ngx_conf_merge_str_value(conf->sr_token_key, prev->sr_token_key, ""); + sscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_ssl_module); + conf->ssl = &sscf->ssl; + return NGX_CONF_OK; } diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 2a8a22564..b3e27c62e 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -307,7 +307,6 @@ ngx_http_init_connection(ngx_connection_t *c) if (hc->addr_conf->quic) { ngx_quic_conf_t *qcf; ngx_http_connection_t *phc; - ngx_http_ssl_srv_conf_t *sscf; ngx_http_core_loc_conf_t *clcf; hc->ssl = 1; @@ -336,10 +335,7 @@ ngx_http_init_connection(ngx_connection_t *c) qcf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_quic_module); - sscf = ngx_http_get_module_srv_conf(hc->conf_ctx, - ngx_http_ssl_module); - - ngx_quic_run(c, &sscf->ssl, qcf); + ngx_quic_run(c, qcf); return; } -- cgit