]> git.kaiwu.me - nginx.git/commitdiff
HTTP/3: use max table capacity for insert buffer allocation
authorRoman Arutyunyan <arut@nginx.com>
Tue, 19 May 2026 11:43:41 +0000 (15:43 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Wed, 17 Jun 2026 14:40:35 +0000 (07:40 -0700)
Previously, current capacity was used for the allocation, which could
be insufficient if table capacity was later increased.

src/http/v3/ngx_http_v3_table.c

index 3b0b7b309f869e7f1216cdd8d53ac93cd3744ac6..eac3da6bc9ce5238e5c19aa28f1dd4dae6e8f40a 100644 (file)
@@ -159,13 +159,17 @@ ngx_buf_t *
 ngx_http_v3_get_insert_buffer(ngx_connection_t *c)
 {
     ngx_http_v3_session_t        *h3c;
+    ngx_http_v3_srv_conf_t       *h3scf;
     ngx_http_v3_dynamic_table_t  *dt;
 
     h3c = ngx_http_v3_get_session(c);
     dt = &h3c->table;
 
     if (dt->insert_buffer == NULL) {
-        dt->insert_buffer = ngx_create_temp_buf(c->pool, dt->capacity);
+        h3scf = ngx_http_v3_get_module_srv_conf(c, ngx_http_v3_module);
+
+        dt->insert_buffer = ngx_create_temp_buf(c->pool,
+                                                h3scf->max_table_capacity);
         if (dt->insert_buffer == NULL) {
             return NULL;
         }