varnishtest "h2 ReqAcct"

server s1 {
	rxreq
	txresp -noserver -bodylen 12345
} -start

varnish v1 -cliok "param.set feature +http2"
varnish v1 -vcl+backend {
	sub vcl_deliver {
		# make ReqAcct deterministic
		unset resp.http.via;
	}
} -start

logexpect l1 -v v1 -g raw -q ReqAcct {
	expect ? 1001	ReqAcct "46 0 46 69 12345 12414"
	expect ? 1003	ReqAcct "46 0 46 74 1000 1074"
} -start

client c1 {
	txpri

	stream 0 {
		rxsettings
		expect settings.ack == false
		txsettings -ack
		txsettings -winsize 1000
		rxsettings
		expect settings.ack == true
	} -run

	stream 1 {
		txreq -hdr stream 1
		rxhdrs
		rxdata
		txwinup -size 11345
		rxdata
	} -run

	stream 3 {
		txreq -hdr stream 3
		rxhdrs
		rxdata
		txrst
	} -run
} -run

logexpect l1 -wait
