aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2020-09-29 22:09:09 +0100
committerRoman Arutyunyan <arut@nginx.com>2020-09-29 22:09:09 +0100
commit1f90fccd972d3395239a7f6dea733dfe3627abc5 (patch)
treea966e659fd9a97952444fdb3442c49cb80989636 /src/http/ngx_http_request.c
parent0824d61fc9d28898e7d771825eca2880bc08df8b (diff)
downloadnginx-1f90fccd972d3395239a7f6dea733dfe3627abc5.tar.gz
nginx-1f90fccd972d3395239a7f6dea733dfe3627abc5.zip
QUIC: switch stream context to a server selected by SNI.
Previously the default server configuration context was used until the :authority or host header was parsed. This led to using the configuration parameters like client_header_buffer_size or request_pool_size from the default server rather than from the server selected by SNI. Also, the switch to the right server log is implemented. This issue manifested itself as QUIC stream being logged to the default server log until :authority or host is parsed.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index f1c6fa45c..2a8a22564 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -305,8 +305,10 @@ ngx_http_init_connection(ngx_connection_t *c)
#if (NGX_HTTP_QUIC)
if (hc->addr_conf->quic) {
- ngx_quic_conf_t *qcf;
- ngx_http_ssl_srv_conf_t *sscf;
+ 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;
@@ -340,6 +342,17 @@ ngx_http_init_connection(ngx_connection_t *c)
ngx_quic_run(c, &sscf->ssl, qcf);
return;
}
+
+ phc = c->qs->parent->data;
+
+ if (phc->ssl_servername) {
+ hc->ssl_servername = phc->ssl_servername;
+ hc->conf_ctx = phc->conf_ctx;
+
+ clcf = ngx_http_get_module_loc_conf(hc->conf_ctx,
+ ngx_http_core_module);
+ ngx_set_connection_log(c, clcf->error_log);
+ }
}
#endif