aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2021-01-22 16:34:06 +0300
committerRoman Arutyunyan <arut@nginx.com>2021-01-22 16:34:06 +0300
commit9e489d208fff35c490b43980a064c38cc8dc4f2c (patch)
tree13434e205541c72867fff50bcd2c05662078d611 /src/http/modules
parentf3c9e9f9616066c6f1d16b9b1e01b7a3d0e2503a (diff)
downloadnginx-9e489d208fff35c490b43980a064c38cc8dc4f2c.tar.gz
nginx-9e489d208fff35c490b43980a064c38cc8dc4f2c.zip
HTTP/3: refactored request parser.
The change reduces diff to the default branch for src/http/ngx_http_request.c and src/http/ngx_http_parse.c.
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_quic_module.c37
-rw-r--r--src/http/modules/ngx_http_quic_module.h2
2 files changed, 38 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_quic_module.c b/src/http/modules/ngx_http_quic_module.c
index ff79cdc8d..5314af35b 100644
--- a/src/http/modules/ngx_http_quic_module.c
+++ b/src/http/modules/ngx_http_quic_module.c
@@ -175,6 +175,43 @@ static ngx_http_variable_t ngx_http_quic_vars[] = {
};
+ngx_int_t
+ngx_http_quic_init(ngx_connection_t *c)
+{
+ ngx_quic_conf_t *qcf;
+ ngx_http_connection_t *hc, *phc;
+ ngx_http_core_loc_conf_t *clcf;
+
+ hc = c->data;
+
+ hc->ssl = 1;
+
+ if (c->quic == NULL) {
+ c->log->connection = c->number;
+
+ qcf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_quic_module);
+
+ ngx_quic_run(c, qcf);
+
+ return NGX_DONE;
+ }
+
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http init quic stream");
+
+ phc = c->quic->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);
+ }
+
+ return NGX_OK;
+}
+
+
static ngx_int_t
ngx_http_variable_quic(ngx_http_request_t *r,
ngx_http_variable_value_t *v, uintptr_t data)
diff --git a/src/http/modules/ngx_http_quic_module.h b/src/http/modules/ngx_http_quic_module.h
index bd4930f8a..bc75dd501 100644
--- a/src/http/modules/ngx_http_quic_module.h
+++ b/src/http/modules/ngx_http_quic_module.h
@@ -18,7 +18,7 @@
#define NGX_HTTP_QUIC_ALPN_DRAFT_FMT "\x05hq-%02uD"
-extern ngx_module_t ngx_http_quic_module;
+ngx_int_t ngx_http_quic_init(ngx_connection_t *c);
#endif /* _NGX_HTTP_QUIC_H_INCLUDED_ */