MINOR: h2: expose tune.h2.header-table-size to configure the table size
It's the HPACK header table size which is to be advertised in the settings
frames. It defaults to 4096.
diff --git a/src/mux_h2.c b/src/mux_h2.c
index a15e4c7..3fbac8c 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -16,6 +16,10 @@
#include <proto/stream.h>
+/* a few settings from the global section */
+static int h2_settings_header_table_size = 4096; /* initial value */
+
+
/*****************************************************************/
/* functions below are dedicated to the mux setup and management */
/*****************************************************************/
@@ -126,6 +130,21 @@
/* functions below are dedicated to the config parsers */
/*******************************************************/
+/* config parser for global "tune.h2.header-table-size" */
+static int h2_parse_header_table_size(char **args, int section_type, struct proxy *curpx,
+ struct proxy *defpx, const char *file, int line,
+ char **err)
+{
+ if (too_many_args(1, args, err, NULL))
+ return -1;
+
+ h2_settings_header_table_size = atoi(args[1]);
+ if (h2_settings_header_table_size < 4096 || h2_settings_header_table_size > 65536) {
+ memprintf(err, "'%s' expects a numeric value between 4096 and 65536.", args[0]);
+ return -1;
+ }
+ return 0;
+}
/****************************************/
@@ -155,6 +174,7 @@
/* config keyword parsers */
static struct cfg_kw_list cfg_kws = {ILH, {
+ { CFG_GLOBAL, "tune.h2.header-table-size", h2_parse_header_table_size },
{ 0, NULL, NULL }
}};