#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
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;
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,
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;
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);
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
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;
}