aboutsummaryrefslogtreecommitdiff
path: root/src/http/v3/ngx_http_v3_module.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2020-07-02 15:34:05 +0300
committerRoman Arutyunyan <arut@nginx.com>2020-07-02 15:34:05 +0300
commita687d08062d8cb029ab82249aa55833cf44be3ce (patch)
tree57ab07f1a9e3471ba1b43e6635bcde4094277bc7 /src/http/v3/ngx_http_v3_module.c
parenta7ef0da3c8b64f2b5f4d8a7e73e724a74611284c (diff)
downloadnginx-a687d08062d8cb029ab82249aa55833cf44be3ce.tar.gz
nginx-a687d08062d8cb029ab82249aa55833cf44be3ce.zip
HTTP/3: refactored dynamic table implementation.
Previously dynamic table was not functional because of zero limit on its size set by default. Now the following changes enable it: - new directives to set SETTINGS_QPACK_MAX_TABLE_CAPACITY and SETTINGS_QPACK_BLOCKED_STREAMS - send settings with SETTINGS_QPACK_MAX_TABLE_CAPACITY and SETTINGS_QPACK_BLOCKED_STREAMS to the client - send Insert Count Increment to the client - send Header Acknowledgement to the client - evict old dynamic table entries on overflow - decode Required Insert Count from client - block stream if Required Insert Count is not reached
Diffstat (limited to 'src/http/v3/ngx_http_v3_module.c')
-rw-r--r--src/http/v3/ngx_http_v3_module.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/http/v3/ngx_http_v3_module.c b/src/http/v3/ngx_http_v3_module.c
index 17029934e..386209cb7 100644
--- a/src/http/v3/ngx_http_v3_module.c
+++ b/src/http/v3/ngx_http_v3_module.c
@@ -125,6 +125,20 @@ static ngx_command_t ngx_http_v3_commands[] = {
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,
+ NGX_HTTP_SRV_CONF_OFFSET,
+ offsetof(ngx_http_v3_srv_conf_t, max_table_capacity),
+ NULL },
+
+ { ngx_string("http3_max_blocked_streams"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_num_slot,
+ NGX_HTTP_SRV_CONF_OFFSET,
+ offsetof(ngx_http_v3_srv_conf_t, max_blocked_streams),
+ NULL },
+
ngx_null_command
};
@@ -276,6 +290,8 @@ ngx_http_v3_create_srv_conf(ngx_conf_t *cf)
v3cf->quic.retry = NGX_CONF_UNSET;
v3cf->max_field_size = NGX_CONF_UNSET_SIZE;
+ v3cf->max_table_capacity = NGX_CONF_UNSET_SIZE;
+ v3cf->max_blocked_streams = NGX_CONF_UNSET_UINT;
return v3cf;
}
@@ -342,6 +358,14 @@ ngx_http_v3_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
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_conf_merge_uint_value(conf->max_blocked_streams,
+ prev->max_blocked_streams,
+ NGX_HTTP_V3_DEFAULT_MAX_BLOCKED_STREAMS);
+
return NGX_CONF_OK;
}