comparison src/http/v3/ngx_http_v3_module.c @ 8454:032cb35ce758 quic

HTTP/3: http3_max_field_size directive to limit string size. Client streams may send literal strings which are now limited in size by the new directive. The default value is 4096. The directive is similar to HTTP/2 directive http2_max_field_size.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 29 Jun 2020 15:56:14 +0300
parents 6633f17044eb
children c9538aef3211
comparison
equal deleted inserted replaced
8453:c8cabb5d45f5 8454:032cb35ce758
114 { ngx_string("quic_retry"), 114 { ngx_string("quic_retry"),
115 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG, 115 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
116 ngx_conf_set_flag_slot, 116 ngx_conf_set_flag_slot,
117 NGX_HTTP_SRV_CONF_OFFSET, 117 NGX_HTTP_SRV_CONF_OFFSET,
118 offsetof(ngx_http_v3_srv_conf_t, quic.retry), 118 offsetof(ngx_http_v3_srv_conf_t, quic.retry),
119 NULL },
120
121 { ngx_string("http3_max_field_size"),
122 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
123 ngx_conf_set_size_slot,
124 NGX_HTTP_SRV_CONF_OFFSET,
125 offsetof(ngx_http_v3_srv_conf_t, max_field_size),
119 NULL }, 126 NULL },
120 127
121 ngx_null_command 128 ngx_null_command
122 }; 129 };
123 130
266 v3cf->quic.disable_active_migration = NGX_CONF_UNSET_UINT; 273 v3cf->quic.disable_active_migration = NGX_CONF_UNSET_UINT;
267 v3cf->quic.active_connection_id_limit = NGX_CONF_UNSET_UINT; 274 v3cf->quic.active_connection_id_limit = NGX_CONF_UNSET_UINT;
268 275
269 v3cf->quic.retry = NGX_CONF_UNSET; 276 v3cf->quic.retry = NGX_CONF_UNSET;
270 277
278 v3cf->max_field_size = NGX_CONF_UNSET_SIZE;
279
271 return v3cf; 280 return v3cf;
272 } 281 }
273 282
274 283
275 static char * 284 static char *
327 if (RAND_bytes(conf->quic.token_key, sizeof(conf->quic.token_key)) <= 0) { 336 if (RAND_bytes(conf->quic.token_key, sizeof(conf->quic.token_key)) <= 0) {
328 return NGX_CONF_ERROR; 337 return NGX_CONF_ERROR;
329 } 338 }
330 } 339 }
331 340
341 ngx_conf_merge_size_value(conf->max_field_size,
342 prev->max_field_size,
343 NGX_HTTP_V3_DEFAULT_MAX_FIELD_SIZE);
332 344
333 return NGX_CONF_OK; 345 return NGX_CONF_OK;
334 } 346 }
335 347
336 348