aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2023-05-19 21:46:36 +0400
committerRoman Arutyunyan <arut@nginx.com>2023-05-19 21:46:36 +0400
commit4b0266174814e6cf60a275321121dbaab084ee64 (patch)
tree1c47a0b456cb1bb6d6dd08aa2d94342d738b56c6 /src/http/ngx_http_core_module.c
parent1a8ef991d92d22eb8aded7f49595dd31a639e8a4 (diff)
parent94941bd840ce7b011a36f7fe33f3fc7f4c600688 (diff)
downloadnginx-4b0266174814e6cf60a275321121dbaab084ee64.tar.gz
nginx-4b0266174814e6cf60a275321121dbaab084ee64.zip
Merged with the quic branch.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 2140e0627..bd8f7666a 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -3005,6 +3005,7 @@ ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
lsopt.socklen = sizeof(struct sockaddr_in);
lsopt.backlog = NGX_LISTEN_BACKLOG;
+ lsopt.type = SOCK_STREAM;
lsopt.rcvbuf = -1;
lsopt.sndbuf = -1;
#if (NGX_HAVE_SETFIB)
@@ -3986,6 +3987,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_memzero(&lsopt, sizeof(ngx_http_listen_opt_t));
lsopt.backlog = NGX_LISTEN_BACKLOG;
+ lsopt.type = SOCK_STREAM;
lsopt.rcvbuf = -1;
lsopt.sndbuf = -1;
#if (NGX_HAVE_SETFIB)
@@ -4184,6 +4186,19 @@ 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_V3)
+ lsopt.quic = 1;
+ lsopt.type = SOCK_DGRAM;
+ continue;
+#else
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "the \"quic\" parameter requires "
+ "ngx_http_v3_module");
+ return NGX_CONF_ERROR;
+#endif
+ }
+
if (ngx_strncmp(value[n].data, "so_keepalive=", 13) == 0) {
if (ngx_strcmp(&value[n].data[13], "on") == 0) {
@@ -4285,6 +4300,28 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
+#if (NGX_HTTP_V3)
+
+ if (lsopt.quic) {
+#if (NGX_HTTP_SSL)
+ if (lsopt.ssl) {
+ return "\"ssl\" parameter is incompatible with \"quic\"";
+ }
+#endif
+
+#if (NGX_HTTP_V2)
+ if (lsopt.http2) {
+ return "\"http2\" parameter is incompatible with \"quic\"";
+ }
+#endif
+
+ if (lsopt.proxy_protocol) {
+ return "\"proxy_protocol\" parameter is incompatible with \"quic\"";
+ }
+ }
+
+#endif
+
for (n = 0; n < u.naddrs; n++) {
for (i = 0; i < n; i++) {