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

Maxim Dounin mdounin at mdounin.ru
Mon Jan 30 01:26:27 UTC 2023


Hello!

On Thu, Jan 26, 2023 at 03:50:46PM +0400, Roman Arutyunyan wrote:

> # 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 555913c358221f647bbace26165bef5eb614add4
> # Parent  250539ea3e05d0ac2ead4784a1b44f28ff4d1ef6
> 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
> @@ -4303,10 +4303,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++) {

Looks good.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list