HTTP/3: removed http3_max_field_size.

Instead, size of one large_client_header_buffers buffer is used.
This commit is contained in:
Roman Arutyunyan 2021-02-16 18:50:01 +03:00
parent 8ca2f73073
commit c83be09720
3 changed files with 5 additions and 19 deletions

View File

@ -46,7 +46,6 @@
#define NGX_HTTP_V3_STREAM_SERVER_DECODER 5
#define NGX_HTTP_V3_MAX_KNOWN_STREAM 6
#define NGX_HTTP_V3_DEFAULT_MAX_FIELD_SIZE 4096
#define NGX_HTTP_V3_DEFAULT_MAX_TABLE_CAPACITY 16384
#define NGX_HTTP_V3_DEFAULT_MAX_BLOCKED_STREAMS 16
#define NGX_HTTP_V3_DEFAULT_MAX_CONCURRENT_PUSHES 10
@ -86,7 +85,6 @@
typedef struct {
ngx_quic_tp_t quic;
size_t max_field_size;
size_t max_table_capacity;
ngx_uint_t max_blocked_streams;
ngx_uint_t max_concurrent_pushes;

View File

@ -24,13 +24,6 @@ static char *ngx_http_v3_push(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static ngx_command_t ngx_http_v3_commands[] = {
{ ngx_string("http3_max_field_size"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
ngx_conf_set_size_slot,
NGX_HTTP_SRV_CONF_OFFSET,
offsetof(ngx_http_v3_srv_conf_t, max_field_size),
NULL },
{ ngx_string("http3_max_table_capacity"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
ngx_conf_set_size_slot,
@ -157,7 +150,6 @@ ngx_http_v3_create_srv_conf(ngx_conf_t *cf)
return NULL;
}
h3scf->max_field_size = NGX_CONF_UNSET_SIZE;
h3scf->max_table_capacity = NGX_CONF_UNSET_SIZE;
h3scf->max_blocked_streams = NGX_CONF_UNSET_UINT;
h3scf->max_concurrent_pushes = NGX_CONF_UNSET_UINT;
@ -172,10 +164,6 @@ ngx_http_v3_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_http_v3_srv_conf_t *prev = parent;
ngx_http_v3_srv_conf_t *conf = child;
ngx_conf_merge_size_value(conf->max_field_size,
prev->max_field_size,
NGX_HTTP_V3_DEFAULT_MAX_FIELD_SIZE);
ngx_conf_merge_size_value(conf->max_table_capacity,
prev->max_table_capacity,
NGX_HTTP_V3_DEFAULT_MAX_TABLE_CAPACITY);

View File

@ -489,7 +489,7 @@ ngx_http_v3_parse_literal(ngx_connection_t *c, ngx_http_v3_parse_literal_t *st,
u_char ch)
{
ngx_uint_t n;
ngx_http_v3_srv_conf_t *h3scf;
ngx_http_core_srv_conf_t *cscf;
enum {
sw_start = 0,
sw_value
@ -505,11 +505,11 @@ ngx_http_v3_parse_literal(ngx_connection_t *c, ngx_http_v3_parse_literal_t *st,
n = st->length;
h3scf = ngx_http_v3_get_module_srv_conf(c, ngx_http_v3_module);
cscf = ngx_http_v3_get_module_srv_conf(c, ngx_http_core_module);
if (n > h3scf->max_field_size) {
if (n > cscf->large_client_header_buffers.size) {
ngx_log_error(NGX_LOG_INFO, c->log, 0,
"client exceeded http3_max_field_size limit");
"client sent too large header field");
return NGX_HTTP_V3_ERR_EXCESSIVE_LOAD;
}