[master] a575331 Ignore DATA received after stream closed
Poul-Henning Kamp
phk at FreeBSD.org
Fri Apr 7 09:25:06 CEST 2017
commit a575331d6043c7dbaf5ed9aa850e8619bf42aad4
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Fri Apr 7 07:20:20 2017 +0000
Ignore DATA received after stream closed
Fixes #2304
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 1083d0e..a44d05b 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -636,8 +636,9 @@ h2_rx_data(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
unsigned wi;
(void)wrk;
- AN(r2);
ASSERT_RXTHR(h2);
+ if (r2 == NULL)
+ return (0);
Lck_Lock(&h2->sess->mtx);
AZ(h2->mailcall);
h2->mailcall = r2;
diff --git a/bin/varnishtest/tests/t02003.vtc b/bin/varnishtest/tests/t02003.vtc
index db5fb31..2f32a51 100644
--- a/bin/varnishtest/tests/t02003.vtc
+++ b/bin/varnishtest/tests/t02003.vtc
@@ -417,3 +417,35 @@ varnish v1 -expect MEMPOOL.req1.live == 0
varnish v1 -expect MEMPOOL.sess0.live == 0
varnish v1 -expect MEMPOOL.sess1.live == 0
+#######################################################################
+# Test DATA error conditions
+
+client c1 {
+ stream 1 {
+ txdata -data "FOOBAR"
+ } -run
+ stream 0 {
+ rxgoaway
+ } -run
+ expect_close
+} -run
+
+client c1 {
+ stream 1 {
+ txreq
+ rxresp
+ txdata -data "FOOBAR"
+ } -run
+ stream 3 {
+ txreq
+ rxresp
+ } -run
+} -run
+
+varnish v1 -vsl_catchup
+
+varnish v1 -expect MEMPOOL.req0.live == 0
+varnish v1 -expect MEMPOOL.req1.live == 0
+varnish v1 -expect MEMPOOL.sess0.live == 0
+varnish v1 -expect MEMPOOL.sess1.live == 0
+
More information about the varnish-commit
mailing list