MEDIUM: hpack: use a pool for the hpack table
Instead of using malloc/free to allocate an HPACK table, let's declare
a pool. However the HPACK size is configured by the H2 mux, so it's
also this one which allocates it after post_check.
diff --git a/src/hpack-tbl.c b/src/hpack-tbl.c
index 727ff7a..effe5e0 100644
--- a/src/hpack-tbl.c
+++ b/src/hpack-tbl.c
@@ -101,6 +101,8 @@
[61] = { .n = IST("www-authenticate"), .v = IST("") },
};
+struct pool_head *pool_head_hpack_tbl = NULL;
+
/* returns the slot number of the oldest entry (tail). Must not be used on an
* empty table.
*/
@@ -173,7 +175,7 @@
/* Note: for small tables we could use alloca() instead but
* portability especially for large tables can be problematic.
*/
- alt_dht = hpack_dht_alloc(dht->size);
+ alt_dht = hpack_dht_alloc();
if (!alt_dht)
return NULL;