varnishtest "Check read-head / partial pipelining"

server s1 {
	rxreq
	expect req.url == "/foo"
	txresp -body "foo"
	rxreq
	expect req.url == "/bar"
	txresp -body "foobar"
} -start

varnish v1 -vcl+backend {}

# NB: The accept_filter param may not exist.
varnish v1 -cli "param.set accept_filter false"
varnish v1 -start

client c1 {
	send "GET /foo HTTP/1.1\r\nHost: foo\r\n\r\nGET "
	rxresp
	expect resp.status == 200
	expect resp.bodylen == 3
	expect resp.http.x-varnish == "1001"
	send "/bar HTTP/1.1\nHost: foo\n\nGET /bar "
	rxresp
	expect resp.status == 200
	expect resp.bodylen == 6
	expect resp.http.x-varnish == "1003"
	send "HTTP/1.1\nHost: foo\n\n"
	rxresp
	expect resp.status == 200
	expect resp.bodylen == 6
	expect resp.http.x-varnish == "1005 1004"
} -run

varnish v1 -expect sess_readahead == 2
