varnishtest "request with body parked on waitinglist - almost identical to c00013.vtc"

barrier b1 cond 2
barrier b2 cond 2

server s1 {
	rxreq
	expect req.url == "/foo"
	send "HTTP/1.0 200 OK\r\nConnection: close\r\n\r\n"
	delay .2
	barrier b1 sync
	delay .2
	send "line1\n"
	delay .2
	barrier b2 sync
	send "line2\n"
} -start

# -cli because accept_filter may not be supported
varnish v1 -cli "param.set accept_filter off"

varnish v1 -vcl+backend {
	sub vcl_backend_response {
		set beresp.do_stream = false;
	}
} -start

varnish v1 -cliok "param.set debug +syncvsl"

client c1 {
	txreq -url "/foo" -hdr "client: c1"
	rxresp
	expect resp.status == 200
	expect resp.bodylen == 12
	expect resp.http.x-varnish == "1001"
} -start

barrier b1 sync

client c2 {
	txreq -url "/foo" -hdr "client: c2" -body 1
	delay .2
	barrier b2 sync
	rxresp
	expect resp.status == 200
	expect resp.bodylen == 12
	expect resp.http.x-varnish == "1004 1002"
} -run

client c1 -wait

varnish v1 -expect busy_sleep >= 1
varnish v1 -expect busy_wakeup >= 1
