aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2021-02-16 18:50:01 +0300
committerRoman Arutyunyan <arut@nginx.com>2021-02-16 18:50:01 +0300
commitc83be09720cf8dff041db6581d9df26c88bd3463 (patch)
tree30ecc4832cdd4184fd06a24cc67e764f628ecf17
parent8ca2f73073da431d8e747589eac5b49a7c0faa5b (diff)
downloadnginx-c83be09720cf8dff041db6581d9df26c88bd3463.tar.gz
nginx-c83be09720cf8dff041db6581d9df26c88bd3463.zip
HTTP/3: removed http3_max_field_size.
Instead, size of one large_client_header_buffers buffer is used.
-rw-r--r--src/http/v3/ngx_http_v3.h2
-rw-r--r--src/http/v3/ngx_http_v3_module.c12
-rw-r--r--src/http/v3/ngx_http_v3_parse.c10
3 files changed, 5 insertions, 19 deletions
diff --git a/src/http/v3/ngx_http_v3.h b/src/http/v3/ngx_http_v3.h
index 510e66bb5..5223d8f75 100644
--- a/src/http/v3/ngx_http_v3.h
+++ b/src/http/v3/ngx_http_v3.h
@@ -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;
diff --git a/src/http/v3/ngx_http_v3_module.c b/src/http/v3/ngx_http_v3_module.c
index 89748f5f4..18da90aab 100644
--- a/src/http/v3/ngx_http_v3_module.c
+++ b/src/http/v3/ngx_http_v3_module.c
@@ -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);
diff --git a/src/http/v3/ngx_http_v3_parse.c b/src/http/v3/ngx_http_v3_parse.c
index 7c22b482c..b7cf242ba 100644
--- a/src/http/v3/ngx_http_v3_parse.c
+++ b/src/http/v3/ngx_http_v3_parse.c
@@ -488,8 +488,8 @@ static ngx_int_t
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_uint_t n;
+ 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;
}