vtest "HPACK coverage"

server s1 {
	rxreq
	expect req.http.host == www.example.com
	expect req.http.foohdr == FOOcont
	txresp -status 500 -bodylen 10
	rxreq
	expect req.http.host == www.example.com
	expect req.http.foohdr == FOOcont2
	txresp -status 404 -bodylen 20
} -start

vinyl v1 -vcl+backend {} -start

vinyl v1 -cliok "param.set feature +http2"
vinyl v1 -cliok "param.set debug +syncvsl"

client c1 {
	stream 7 {
		txreq \
			-litIdxHdr inc 1 huf "www.example.com" \
			-idxHdr 16 \
			-litHdr inc huf "foohdr" huf "FOOcont"
		rxresp
		expect resp.status == 500
		expect resp.bodylen == 10
	} -run
	stream 9 {
		txreq \
			-idxHdr 63 \
			-litIdxHdr never 62 plain "FOOcont2"
		rxresp
		expect resp.status == 404
		expect resp.bodylen == 20
	} -run
} -run

vinyl v1 -expect MEMPOOL.req0.live == 0
vinyl v1 -expect MEMPOOL.req1.live == 0
vinyl v1 -expect MEMPOOL.sess0.live == 0
vinyl v1 -expect MEMPOOL.sess1.live == 0

client c1 {
	stream 11 {
		txreq -hdr sna[]fu foo.bar -pad cotton
		rxrst
	} -run
} -run

client c1 {
	stream 13 {
		txreq -hdr snaFu foo.bar -pad cotton
		rxrst
	} -run
} -run

