[master] e2dd109 Expose various H2_SETTINGs as parameters
Dag Haavi Finstad
daghf at varnish-software.com
Tue Jan 16 08:28:05 UTC 2018
commit e2dd109f77b3cdd82c76cefdecab88f5d383fd23
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date: Mon Jan 8 14:36:56 2018 +0100
Expose various H2_SETTINGs as parameters
diff --git a/bin/varnishd/http2/cache_http2_session.c b/bin/varnishd/http2/cache_http2_session.c
index 252b631..afa77fc 100644
--- a/bin/varnishd/http2/cache_http2_session.c
+++ b/bin/varnishd/http2/cache_http2_session.c
@@ -62,6 +62,16 @@ static const struct h2_settings H2_proto_settings = {
#include "tbl/h2_settings.h"
};
+static void
+h2_local_settings(struct h2_settings *h2s)
+{
+ *h2s = H2_proto_settings;
+#define H2_SETTINGS_PARAM_ONLY
+#define H2_SETTING(U, l, ...) \
+ h2s->l = cache_param->h2_##l;
+#include "tbl/h2_settings.h"
+#undef H2_SETTINGS_PARAM_ONLY
+}
/**********************************************************************
* The h2_sess struct needs many of the same things as a request,
@@ -101,7 +111,7 @@ h2_new_sess(const struct worker *wrk, struct sess *sp, struct req *srq)
h2->rxthr = pthread_self();
VTAILQ_INIT(&h2->streams);
VTAILQ_INIT(&h2->txqueue);
- h2->local_settings = H2_proto_settings;
+ h2_local_settings(&h2->local_settings);
h2->remote_settings = H2_proto_settings;
AZ(VHT_Init(h2->dectbl,
diff --git a/include/tbl/h2_settings.h b/include/tbl/h2_settings.h
index 7214bef..04c24f3 100644
--- a/include/tbl/h2_settings.h
+++ b/include/tbl/h2_settings.h
@@ -47,6 +47,7 @@ H2_SETTING( // rfc7540,l,2097,2103
0xffffffff,
0
)
+#ifndef H2_SETTINGS_PARAM_ONLY
H2_SETTING( // rfc7540,l,2105,2114
ENABLE_PUSH,
enable_push,
@@ -56,6 +57,7 @@ H2_SETTING( // rfc7540,l,2105,2114
1,
H2CE_PROTOCOL_ERROR
)
+#endif
H2_SETTING( // rfc7540,l,2116,2121
MAX_CONCURRENT_STREAMS,
max_concurrent_streams,
diff --git a/include/tbl/params.h b/include/tbl/params.h
index 454021d..436c4af 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -1732,6 +1732,80 @@ PARAM(
/* func */ NULL
)
+PARAM(
+ /* name */ h2_header_table_size,
+ /* typ */ bytes_u,
+ /* min */ "0",
+ /* max */ NULL,
+ /* default */ "4k",
+ /* units */ "bytes",
+ /* flags */ 0,
+ /* s-text */
+ "HTTP2 header table size.\n"
+ "This is the size that will be used for the HPACK dynamic\n"
+ "decoding table.",
+ /* l-text */ "",
+ /* func */ NULL
+)
+
+PARAM(
+ /* name */ h2_max_concurrent_streams,
+ /* typ */ uint,
+ /* min */ "0",
+ /* max */ "4294967294",
+ /* default */ "100",
+ /* units */ "streams",
+ /* flags */ 0,
+ /* s-text */
+ "HTTP2 Maximum number of concurrent streams.\n"
+ "This is the number of requests that can be active\n"
+ "at the same time for a single HTTP2 connection.",
+ /* l-text */ "",
+ /* func */ NULL
+)
+
+PARAM(
+ /* name */ h2_initial_window_size,
+ /* typ */ bytes_u,
+ /* min */ "0",
+ /* max */ "2147483647",
+ /* default */ "65535",
+ /* units */ "bytes",
+ /* flags */ 0,
+ /* s-text */
+ "HTTP2 initial flow control window size.",
+ /* l-text */ "",
+ /* func */ NULL
+)
+
+PARAM(
+ /* name */ h2_max_frame_size,
+ /* typ */ bytes_u,
+ /* min */ "16384",
+ /* max */ "16777215",
+ /* default */ "16384",
+ /* units */ "bytes",
+ /* flags */ 0,
+ /* s-text */
+ "HTTP2 maximum per frame payload size we are willing to accept.",
+ /* l-text */ "",
+ /* func */ NULL
+)
+
+PARAM(
+ /* name */ h2_max_header_list_size,
+ /* typ */ bytes_u,
+ /* min */ "0",
+ /* max */ NULL,
+ /* default */ "4294967295",
+ /* units */ "bytes",
+ /* flags */ 0,
+ /* s-text */
+ "HTTP2 maximum size of an uncompressed header list.",
+ /* l-text */ "",
+ /* func */ NULL
+)
+
#undef PARAM
/*lint -restore */
More information about the varnish-commit
mailing list