vtest "Check read-head / partial pipelining"

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

vinyl v1 -vcl+backend {}

# NB: The accept_filter param may not exist.
vinyl v1 -cli "param.set accept_filter false"
vinyl 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-Vinyl == "1001"
	send "/bar HTTP/1.1\nHost: foo\n\nGET /bar "
	rxresp
	expect resp.status == 200
	expect resp.bodylen == 6
	expect resp.http.X-Vinyl == "1003"
	send "HTTP/1.1\nHost: foo\n\n"
	rxresp
	expect resp.status == 200
	expect resp.bodylen == 6
	expect resp.http.X-Vinyl == "1005 1004"
} -run

vinyl v1 -expect sess_readahead == 2
