summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2020-07-21 23:09:22 +0300
committerRoman Arutyunyan <arut@nginx.com>2020-07-21 23:09:22 +0300
commitb813b9ec358862a2a94868bc057420d6eca5c05d (patch)
tree57c250cf526c85f6d1a7889f65110daa9cb7e57b /src/http/ngx_http_core_module.c
parenta305de07e934dd1ff21111d0314821a34880ab13 (diff)
downloadnginx-b813b9ec358862a2a94868bc057420d6eca5c05d.tar.gz
nginx-b813b9ec358862a2a94868bc057420d6eca5c05d.tar.bz2
QUIC: added "quic" listen parameter.
The parameter allows processing HTTP/0.9-2 over QUIC. Also, introduced ngx_http_quic_module and moved QUIC settings there
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 9bb89ee37..ef8b649ef 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -4079,8 +4079,22 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
#endif
}
+ if (ngx_strcmp(value[n].data, "quic") == 0) {
+#if (NGX_HTTP_QUIC)
+ lsopt.quic = 1;
+ lsopt.type = SOCK_DGRAM;
+ continue;
+#else
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "the \"quic\" parameter requires "
+ "ngx_http_quic_module");
+ return NGX_CONF_ERROR;
+#endif
+ }
+
if (ngx_strcmp(value[n].data, "http3") == 0) {
#if (NGX_HTTP_V3)
+ lsopt.quic = 1;
lsopt.http3 = 1;
lsopt.type = SOCK_DGRAM;
continue;
@@ -4201,6 +4215,22 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
+#if (NGX_HTTP_SSL)
+
+#if (NGX_HTTP_V3)
+ if (lsopt.ssl && lsopt.http3) {
+ return "\"ssl\" parameter is incompatible with \"http3\"";
+ }
+#endif
+
+#if (NGX_HTTP_QUIC)
+ if (lsopt.ssl && lsopt.quic) {
+ return "\"ssl\" parameter is incompatible with \"quic\"";
+ }
+#endif
+
+#endif
+
for (n = 0; n < u.naddrs; n++) {
lsopt.sockaddr = u.addrs[n].sockaddr;
lsopt.socklen = u.addrs[n].socklen;