Commit 40aef9c0 authored by Geoff Simmons's avatar Geoff Simmons

add test r01086.vtc

parent bf8730b8
......@@ -87,3 +87,5 @@ client c1 {
expect resp.status == 503
} -run
varnish v1 -expect VBE.vcl1.be.happy == 0
varnish v1 -expect MAIN.n_backend == 2
varnishtest "#1086 junk after gzip from backend and streaming enabled"
server s1 {
# This one will be streamed
rxreq
txresp -nolen \
-hdr "Content-Encoding: gzip" \
-hdr "Transfer-Encoding: Chunked" \
-hdr "Set-Cookie: FOO"
send "14\r\n"
# An empty gzip file:
sendhex "1f8b"
sendhex "08"
sendhex "00"
sendhex "00000000"
sendhex "00"
sendhex "03"
sendhex "0300"
sendhex "00000000"
sendhex "00000000"
send "\r\n"
delay .2
chunked "FOOBAR"
non-fatal
chunkedlen 0
} -start
varnish v1 -vcl {
import backend_dyn from "${vmod_topbuild}/src/.libs/libvmod_backend_dyn.so";
backend dummy { .host = "${bad_ip}"; }
sub vcl_init {
if (!backend_dyn.create(name="be", host="${s1_addr}",
port="${s1_port}")) {
return(fail);
}
}
sub vcl_recv {
set req.backend_hint = backend_dyn.by_name("be");
}
sub vcl_backend_response {
if (beresp.http.set-cookie == "BAR") {
set beresp.do_stream = false;
}
}
} -start
client c1 {
txreq -hdr "Cookie: FOO"
rxresphdrs
expect resp.status == 200
expect_close
} -run
delay .1
server s1 -wait {
fatal
# This one will not be streamed
rxreq
txresp -nolen \
-hdr "Content-Encoding: gzip" \
-hdr "Transfer-Encoding: Chunked" \
-hdr "Set-Cookie: BAR"
send "14\r\n"
# An empty gzip file:
sendhex "1f8b"
sendhex "08"
sendhex "00"
sendhex "00000000"
sendhex "00"
sendhex "03"
sendhex "0300"
sendhex "00000000"
sendhex "00000000"
send "\r\n"
delay .2
chunked "FOOBAR"
non-fatal
chunkedlen 0
} -start
client c1 {
txreq -hdr "Cookie: BAR"
rxresp
expect resp.status == 503
} -run
varnish v1 -expect VBE.vcl1.be.happy == 0
varnish v1 -expect MAIN.n_backend == 2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment