[master] 4060412 Deal with WINDOWS_UPDATES on closed streams

Poul-Henning Kamp phk at FreeBSD.org
Sun Mar 5 11:33:05 CET 2017


commit 4060412e76fe6094c20ec823d20178ea7aee85be
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Mar 5 10:32:14 2017 +0000

    Deal with WINDOWS_UPDATES on closed streams

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 50417d4..d9e0cbb 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -279,6 +279,8 @@ h2_rx_window_update(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
 	wu = vbe32dec(h2->rxf_data) & ~(1LU<<31);
 	if (wu == 0)
 		return (H2SE_PROTOCOL_ERROR);
+	if (r2 == NULL)
+		return (0);
 	Lck_Lock(&h2->sess->mtx);
 	r2->window += wu;
 	Lck_Unlock(&h2->sess->mtx);
diff --git a/bin/varnishtest/tests/t02003.vtc b/bin/varnishtest/tests/t02003.vtc
index ed7ce70..4d7de36 100644
--- a/bin/varnishtest/tests/t02003.vtc
+++ b/bin/varnishtest/tests/t02003.vtc
@@ -81,6 +81,17 @@ client c1 {
 	} -run
 } -run
 
+client c1 {
+	stream 1 {
+		txreq
+		rxresp
+	} -run
+	stream 1 {
+		# WINDOW_UPDATE on closed stream
+		txwinup -size 0x4000
+	} -run
+} -run
+
 #######################################################################
 # Test PING error conditions
 



More information about the varnish-commit mailing list