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

Roman Arutyunyan arut at nginx.com
Tue Feb 7 14:50:32 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 09fd10e9b2e80c998987fc88922f3045c9cb3a3c
# Parent  735f9e501922e4b0a1b20730d62bac35ea398336
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
@@ -4325,10 +4325,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