[master] 2aff3e5 Slightly more coverage.

Poul-Henning Kamp phk at FreeBSD.org
Sat Mar 25 01:09:05 CET 2017


commit 2aff3e5e81aa368d551961d33da7dfdd0c5ec112
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sat Mar 25 00:08:09 2017 +0000

    Slightly more coverage.

diff --git a/bin/varnishd/http2/cache_http2_hpack.c b/bin/varnishd/http2/cache_http2_hpack.c
index ef3496b..4b0a1ce 100644
--- a/bin/varnishd/http2/cache_http2_hpack.c
+++ b/bin/varnishd/http2/cache_http2_hpack.c
@@ -201,7 +201,7 @@ h2h_decode_fini(const struct h2_sess *h2, struct h2h_decode *d)
 		/* HPACK header block didn't finish at an instruction
 		   boundary */
 		VSLb(h2->new_req->http->vsl, SLT_BogoHeader,
-		    "HPACK compression error (%s)", VHD_Error(d->vhd_ret));
+		    "HPACK compression error/fini (%s)", VHD_Error(d->vhd_ret));
 		ret = H2CE_COMPRESSION_ERROR;
 	} else
 		ret = d->error;
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 146754f..e53e0cc 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -470,7 +470,7 @@ h2_do_req(struct worker *wrk, void *priv)
 }
 
 static h2_error
-h2_end_headers(const struct worker *wrk, const struct h2_sess *h2,
+h2_end_headers(struct worker *wrk, const struct h2_sess *h2,
     struct req *req, struct h2_req *r2)
 {
 	h2_error h2e;
@@ -478,8 +478,11 @@ h2_end_headers(const struct worker *wrk, const struct h2_sess *h2,
 	assert(r2->state == H2_S_OPEN);
 	h2e = h2h_decode_fini(h2, r2->decode);
 	FREE_OBJ(r2->decode);
+	r2->state = H2_S_CLOS_REM;		// XXX: not _quite_ true
 	if (h2e != NULL) {
 		VSL(SLT_Debug, 0, "H2H_DECODE_FINI %s", h2e->name);
+		AZ(r2->req->ws->r);
+		h2_del_req(wrk, r2);
 		return (h2e);
 	}
 	VSLb_ts_req(req, "Req", req->t_req);
@@ -492,7 +495,6 @@ h2_end_headers(const struct worker *wrk, const struct h2_sess *h2,
 	req->req_step = R_STP_TRANSPORT;
 	req->task.func = h2_do_req;
 	req->task.priv = req;
-	r2->state = H2_S_CLOS_REM;		// XXX: not _quite_ true
 	XXXAZ(Pool_Task(wrk->pool, &req->task, TASK_QUEUE_REQ));
 	return (0);
 }
diff --git a/bin/varnishtest/tests/t02003.vtc b/bin/varnishtest/tests/t02003.vtc
index a3b99e3..5c6b30c 100644
--- a/bin/varnishtest/tests/t02003.vtc
+++ b/bin/varnishtest/tests/t02003.vtc
@@ -220,6 +220,10 @@ client c1 {
 client c1 {
 	stream 1 {
 		txreq -nohdrend
+		txrst -err 2
+	} -run
+	stream 3 {
+		txreq -nohdrend
 		txrst -err 0x666
 	} -run
 } -run
@@ -332,6 +336,18 @@ client c1 {
 	} -run
 } -run
 
+client c1 {
+	stream 0 {
+		sendhex 000012
+		sendhex 01
+		sendhex 05
+		sendhex 00000001
+		sendhex {8286 8441 0f77 7777 2e65 7861 6d70 6c65 2e63}
+		rxgoaway
+		expect goaway.err == COMPRESSION_ERROR
+	} -run
+} -run
+
 varnish v1 -vsl_catchup
 
 varnish v1 -expect MEMPOOL.req0.live == 0
@@ -345,7 +361,7 @@ varnish v1 -expect MEMPOOL.sess1.live == 0
 client c1 {
 	stream 1 {
 		txreq -nostrend
-		txcont -hdr "foo" "bar"
+		txcont -hdr "bar" "foo"
 	} -run
 	stream 0 {
 		rxgoaway
diff --git a/bin/varnishtest/tests/t02007.vtc b/bin/varnishtest/tests/t02007.vtc
index b168535..8fe8b8d 100644
--- a/bin/varnishtest/tests/t02007.vtc
+++ b/bin/varnishtest/tests/t02007.vtc
@@ -35,6 +35,10 @@ client c1 {
 			-nostrend \
 			-nohdrend
 		txcont \
+			-hdr foo bar \
+			-nohdrend \
+			-nostrend
+		txcont \
 			-hdr expect 100-continue \
 			-hdr content-length 7 \
 			-nostrend



More information about the varnish-commit mailing list