> On 11 Dec 2023, at 14:01, izor...@gmail.com wrote: > > Добрый день. > При использовании такой конфигурации: > listen 0.0.0.0:443 quic reuseport fastopen=1024 backlog=1024 deferred; > listen 0.0.0.0:443 ssl reuseport fastopen=1024 backlog=1024 deferred; > в логах отображается ошибка: > [alert] 2360#2360: setsockopt(TCP_FASTOPEN, 1024) 192.168.252.221:443 > failed, ignored (92: Protocol not available) > [alert] 2360#2360: setsockopt(TCP_DEFER_ACCEPT, 1) for 192.168.252.221:443 > failed, ignored (92: Protocol not available) > > Если не ошибаюсь, то эти опции используются только для TCP протокола? > Тогда может быть надо добавить эти параметры в не поддерживаемые опции, > как сделано для ssl, http2, и proxy_protocol в коде > http://hg.nginx.org/nginx/file/tip/src/http/ngx_http_core_module.c#l4308
Всё так, спасибо. > Поддерживается ли backlog для QUIC? > Значение параметра backlog передаётся в вызов listen(). Для сокетов типа SOCK_DGRAM, используемых в QUIC, listen() не поддерживается и в nginx не вызывается, посему для них параметр backlog не имеет смысла. Добавил в список запрещённых параметров, см. патч. # HG changeset patch # User Sergey Kandaurov <pluk...@nginx.com> # Date 1703084664 -14400 # Wed Dec 20 19:04:24 2023 +0400 # Node ID 5bbdc197980929a82e70c9accfe3f3d3692e6071 # Parent a35f1bd4ffb651b28ef47b9b14779753071140a4 HTTP/3: added more compatibility checks for "listen ... quic". Now "fastopen", "backlog", "accept_filter", "deferred", and "so_keepalive" parameters are not allowed with "quic" in the "listen" directive. Reported by Izorkin. 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 @@ -3961,7 +3961,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx ngx_str_t *value, size; ngx_url_t u; - ngx_uint_t n, i; + ngx_uint_t n, i, backlog; ngx_http_listen_opt_t lsopt; cscf->listen = 1; @@ -4000,6 +4000,8 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx lsopt.ipv6only = 1; #endif + backlog = 0; + for (n = 2; n < cf->args->nelts; n++) { if (ngx_strcmp(value[n].data, "default_server") == 0 @@ -4058,6 +4060,8 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx return NGX_CONF_ERROR; } + backlog = 1; + continue; } @@ -4308,6 +4312,28 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx #if (NGX_HTTP_V3) if (lsopt.quic) { +#if (NGX_HAVE_TCP_FASTOPEN) + if (lsopt.fastopen != -1) { + return "\"fastopen\" parameter is incompatible with \"quic\""; + } +#endif + + if (backlog) { + return "\"backlog\" parameter is incompatible with \"quic\""; + } + +#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) + if (lsopt.accept_filter) { + return "\"accept_filter\" parameter is incompatible with \"quic\""; + } +#endif + +#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) + if (lsopt.deferred_accept) { + return "\"deferred\" parameter is incompatible with \"quic\""; + } +#endif + #if (NGX_HTTP_SSL) if (lsopt.ssl) { return "\"ssl\" parameter is incompatible with \"quic\""; @@ -4320,6 +4346,10 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx } #endif + if (lsopt.so_keepalive) { + return "\"so_keepalive\" parameter is incompatible with \"quic\""; + } + if (lsopt.proxy_protocol) { return "\"proxy_protocol\" parameter is incompatible with \"quic\""; } -- Sergey Kandaurov _______________________________________________ nginx-ru mailing list nginx-ru@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-ru