[PATCH 3 of 3] HTTP/3: trigger more compatibility errors for "listen quic"

Roman Arutyunyan arut at nginx.com
Wed Feb 1 14:01:10 UTC 2023


# HG changeset patch
# User Roman Arutyunyan <arut at nginx.com>
# Date 1674732333 -14400
#      Thu Jan 26 15:25:33 2023 +0400
# Branch quic
# Node ID c38eacf014df31766c72fe120ca21a6f64354a8b
# Parent  139b348815b3f19753176988f06b590a3e0af4c0
HTTP/3: trigger more compatibility errors for "listen quic".

Now "ssl", "proxy_protocol" and "http2" are not allowed with "quic" in "listen"
directive.  Previously, only "ssl" was not allowed.

diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -4326,10 +4326,26 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx
         return NGX_CONF_ERROR;
     }
 
-#if (NGX_HTTP_SSL && NGX_HTTP_V3)
-    if (lsopt.ssl && lsopt.quic) {
-        return "\"ssl\" parameter is incompatible with \"quic\"";
-    }
+#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++) {


More information about the nginx-devel mailing list