comparison src/http/ngx_http_core_module.c @ 9047:c851a2ed5ce8 quic

HTTP/3: "quic" parameter of "listen" directive. Now "listen" directve has a new "quic" parameter which enables QUIC protocol for the address. Further, to enable HTTP/3, a new directive "http3" is introduced. The hq-interop protocol is enabled by "http3_hq" as before. Now application protocol is chosen by ALPN. Previously used "http3" parameter of "listen" is deprecated.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 27 Feb 2023 14:00:56 +0400
parents af5adec171b4
children f4279edda9fd
comparison
equal deleted inserted replaced
9046:7da4791e0264 9047:c851a2ed5ce8
4189 #endif 4189 #endif
4190 } 4190 }
4191 4191
4192 if (ngx_strcmp(value[n].data, "http3") == 0) { 4192 if (ngx_strcmp(value[n].data, "http3") == 0) {
4193 #if (NGX_HTTP_V3) 4193 #if (NGX_HTTP_V3)
4194 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
4195 "the \"http3\" parameter is deprecated, "
4196 "use \"quic\" parameter instead");
4197 lsopt.quic = 1;
4194 lsopt.http3 = 1; 4198 lsopt.http3 = 1;
4195 lsopt.type = SOCK_DGRAM; 4199 lsopt.type = SOCK_DGRAM;
4196 continue; 4200 continue;
4197 #else 4201 #else
4198 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 4202 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
4200 "ngx_http_v3_module"); 4204 "ngx_http_v3_module");
4201 return NGX_CONF_ERROR; 4205 return NGX_CONF_ERROR;
4202 #endif 4206 #endif
4203 } 4207 }
4204 4208
4209 if (ngx_strcmp(value[n].data, "quic") == 0) {
4210 #if (NGX_HTTP_V3)
4211 lsopt.quic = 1;
4212 lsopt.type = SOCK_DGRAM;
4213 continue;
4214 #else
4215 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
4216 "the \"quic\" parameter requires "
4217 "ngx_http_v3_module");
4218 return NGX_CONF_ERROR;
4219 #endif
4220 }
4221
4205 if (ngx_strncmp(value[n].data, "so_keepalive=", 13) == 0) { 4222 if (ngx_strncmp(value[n].data, "so_keepalive=", 13) == 0) {
4206 4223
4207 if (ngx_strcmp(&value[n].data[13], "on") == 0) { 4224 if (ngx_strcmp(&value[n].data[13], "on") == 0) {
4208 lsopt.so_keepalive = 1; 4225 lsopt.so_keepalive = 1;
4209 4226
4302 "invalid parameter \"%V\"", &value[n]); 4319 "invalid parameter \"%V\"", &value[n]);
4303 return NGX_CONF_ERROR; 4320 return NGX_CONF_ERROR;
4304 } 4321 }
4305 4322
4306 #if (NGX_HTTP_SSL && NGX_HTTP_V3) 4323 #if (NGX_HTTP_SSL && NGX_HTTP_V3)
4307 if (lsopt.ssl && lsopt.http3) { 4324 if (lsopt.ssl && lsopt.quic) {
4308 return "\"ssl\" parameter is incompatible with \"http3\""; 4325 return "\"ssl\" parameter is incompatible with \"quic\"";
4309 } 4326 }
4310 #endif 4327 #endif
4311 4328
4312 for (n = 0; n < u.naddrs; n++) { 4329 for (n = 0; n < u.naddrs; n++) {
4313 4330