diff src/http/v3/ngx_http_v3_module.c @ 8456:c9538aef3211 quic

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
author Roman Arutyunyan <arut@nginx.com>
date Thu, 02 Jul 2020 15:34:05 +0300
parents 032cb35ce758
children 0d2b2664b41c
line wrap: on
line diff
--- 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_comman
       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 *
     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 *c
                               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;
 }