Page MenuHomePhabricator
Paste P6190

multi-layer-cl-dostream.vtc
ActivePublic

Authored by ema on Oct 26 2017, 11:25 AM.
Tags
None
Referenced Files
F10448249: multi-layer-cl-dostream.vtc
Oct 26 2017, 1:59 PM
F10448104: multi-layer-cl-dostream.vtc
Oct 26 2017, 1:50 PM
F10443682: multi-layer-cl-dostream.vtc
Oct 26 2017, 11:25 AM
Subscribers
None
varnishtest "CL set with do_stream=false"
server s1 {
loop 3 {
rxreq
txresp -nolen -hdr "Transfer-encoding: chunked"
delay .2
chunkedlen 42
delay .2
chunkedlen 0
}
} -start
varnish v3 -vcl+backend {
sub vcl_backend_response {
if (bereq.url == "/2" || bereq.url == "/3") {
// to check if we've been here
set beresp.http.X-v3-rocks = "maybe";
set beresp.do_gzip = true;
if (!beresp.http.Content-Length) {
set beresp.do_stream = false;
}
if (beresp.http.Content-Length) {
set beresp.http.X-v3-CL = beresp.http.Content-Length;
}
}
}
} -start
varnish v2 -vcl {
backend b {
.host = "${v3_addr}";
.port = "${v3_port}";
}
sub vcl_backend_response {
if (bereq.url == "/2" || bereq.url == "/3") {
// to check if we've been here
set beresp.http.X-v2-rocks = "possibly";
if (beresp.http.Content-Length) {
set beresp.http.X-v2-CL = beresp.http.Content-Length;
}
}
}
} -start
varnish v1 -vcl {
backend b {
.host = "${v2_addr}";
.port = "${v2_port}";
}
sub vcl_backend_response {
if (bereq.url == "/2" || bereq.url == "/3") {
// to check if we've been here
set beresp.http.X-v1-rocks = "surely";
if (beresp.http.Content-Length) {
set beresp.http.X-v1-CL = beresp.http.Content-Length;
}
}
}
} -start
client c1 {
txreq -url "/1"
rxresp
expect resp.http.Content-Length == <undef>
txreq -url "/2"
rxresp
expect resp.http.Content-Length == <undef>
expect resp.http.X-v3-rocks == "maybe"
expect resp.http.X-v2-rocks == "possibly"
expect resp.http.X-v1-rocks == "surely"
expect resp.http.X-v3-CL == <undef>
expect resp.http.X-v2-CL == 31
expect resp.http.X-v1-CL == 31
expect resp.http.Transfer-Encoding == "chunked"
txreq -url "/3" -hdr "Accept-Encoding: gzip"
expect resp.http.Content-Length == <undef>
expect resp.http.X-v3-rocks == "maybe"
expect resp.http.X-v2-rocks == "possibly"
expect resp.http.X-v1-rocks == "surely"
expect resp.http.X-v3-CL == <undef>
expect resp.http.X-v2-CL == 31
expect resp.http.X-v1-CL == 31
expect resp.http.Transfer-Encoding == "chunked"
} -run