[5.1] 06c83b9 Pass sensible maxlengths to HTC_RxStuff() and document how the workspace_client parameter influences H2 traffic.

Poul-Henning Kamp phk at FreeBSD.org
Mon Apr 10 13:59:08 CEST 2017


commit 06c83b96bbb9dc387b5eed9b9065e93ad33021a8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Apr 2 19:58:11 2017 +0000

    Pass sensible maxlengths to HTC_RxStuff() and document how the
    workspace_client parameter influences H2 traffic.

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 4441406..ab0f28d 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -827,7 +827,7 @@ h2_rxframe(struct worker *wrk, struct h2_sess *h2)
 	hs = HTC_RxStuff(h2->htc, h2_frame_complete,
 	    NULL, NULL, NAN,
 	    h2->sess->t_idle + cache_param->timeout_idle + 100,
-	    1024);
+	    16384 + 9);					// rfc7540,l,4228,4228
 	if (hs != HTC_S_COMPLETE) {
 		Lck_Lock(&h2->sess->mtx);
 		VSLb(h2->vsl, SLT_Debug, "H2: No frame (hs=%d)", hs);
diff --git a/bin/varnishd/http2/cache_http2_session.c b/bin/varnishd/http2/cache_http2_session.c
index c1dee52..0dbb541 100644
--- a/bin/varnishd/http2/cache_http2_session.c
+++ b/bin/varnishd/http2/cache_http2_session.c
@@ -238,7 +238,8 @@ h2_ou_session(struct worker *wrk, struct h2_sess *h2,
 
 	/* Wait for PRISM response */
 	hs = HTC_RxStuff(h2->htc, H2_prism_complete,
-	    NULL, NULL, NAN, h2->sess->t_idle + cache_param->timeout_idle, 256);
+	    NULL, NULL, NAN, h2->sess->t_idle + cache_param->timeout_idle,
+	    sizeof H2_prism);
 	if (hs != HTC_S_COMPLETE) {
 		VSLb(h2->vsl, SLT_Debug, "H2: No/Bad OU PRISM (hs=%d)", hs);
 		h2_del_req(wrk, r2);
diff --git a/include/tbl/params.h b/include/tbl/params.h
index f66ffd1..a44b625 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -1611,7 +1611,11 @@ PARAM(
 	/* flags */	DELAYED_EFFECT,
 	/* s-text */
 	"Bytes of HTTP protocol workspace for clients HTTP req/resp.  Use a "
-	"multiple of 4k for VM efficiency.",
+	"multiple of 4k for VM efficiency.\n"
+	"For HTTP/2 compliance this must be at least 20k, in order to "
+	"receive fullsize (=16k) frames from the client.   That usually "
+	"happens only in POST/PUT bodies.  For other traffic-patterns "
+	"smaller values work just fine.",
 	/* l-text */	"",
 	/* func */	NULL
 )



More information about the varnish-commit mailing list