vtest "Check pipelining"

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

vinyl v1 -vcl+backend {} -start

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

vinyl v1 -expect sess_readahead == 2
