[master] cc5c71b Handle RST_STREAM on completed streams

Poul-Henning Kamp phk at FreeBSD.org
Thu Mar 23 23:08:06 CET 2017


commit cc5c71b733c63de72e1ddc3114e0cf569753e19c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Mar 23 22:07:10 2017 +0000

    Handle RST_STREAM on completed streams

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 6683752..b5f07a2 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -273,9 +273,10 @@ h2_rx_rst_stream(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
 {
 	(void)wrk;
 
-	AN(r2);
 	if (h2->rxf_len != 4)			// rfc7540,l,2003,2004
 		return (H2CE_FRAME_SIZE_ERROR);
+	if (r2 == NULL)
+		return (0);
 	Lck_Lock(&h2->sess->mtx);
 	r2->error = h2_streamerror(vbe32dec(h2->rxf_data));
 VSLb(h2->vsl, SLT_Debug, "H2RST %u %d %s", r2->stream, r2->state, r2->error->name);
diff --git a/bin/varnishtest/tests/t02000.vtc b/bin/varnishtest/tests/t02000.vtc
index 16b79b8..6eb9ff8 100644
--- a/bin/varnishtest/tests/t02000.vtc
+++ b/bin/varnishtest/tests/t02000.vtc
@@ -36,6 +36,8 @@ client c1 {
 		txreq -dep 3 -hdr :authority foo.bar -pad cotton
 		rxresp
 		expect resp.status == 200
+		delay 1
+		txrst -err 0x1111
 	} -start
 	stream 0 {
 		txping -data "_-__-_-_"



More information about the varnish-commit mailing list