varnishtest "Reduce dynamic table while incoming headers are flying"

server s1 {
	stream 1 {
		rxreq
		txresp -litHdr inc plain hoge plain fuga
		expect tbl.enc[1].key == "hoge"
		expect tbl.enc[1].value == "fuga"
		expect tbl.enc.size == 40

	} -run


	stream 3 {
		rxreq
		txresp -idxHdr 62 -litHdr inc plain "foo" plain "bar"
	} -run

	stream 0 { rxsettings	} -run
} -start

client c1 -connect ${s1_sock} {
	stream 1 {
		txreq
		rxresp
		expect tbl.dec[1].key == "hoge"
		expect tbl.dec[1].value == "fuga"
		expect tbl.dec.size == 40
		expect tbl.dec.length == 1
	} -run

	stream 3 { txreq		} -run
	stream 0 { txsettings -hdrtbl 0 } -run

	non_fatal
	stream 3 {
		rxresp
		expect resp.http.foo == <undef>
	} -run

} -run

server s1 -wait
