Commit 07e80a0f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Dridi Boukelmoune

Attempt to stabilize test g00005 by making the test do what it

purports to say on the tin, and by removing the quantum-test
it trips over.
parent af6408c1
...@@ -315,21 +315,18 @@ vdp_gunzip(struct req *req, enum vdp_action act, void **priv, ...@@ -315,21 +315,18 @@ vdp_gunzip(struct req *req, enum vdp_action act, void **priv,
http_Unset(req->resp, H_Content_Encoding); http_Unset(req->resp, H_Content_Encoding);
req->resp_len = -1; req->resp_len = -1;
if (req->objcore->boc != NULL)
return (0); /* No idea about length (yet) */
p = ObjGetAttr(req->wrk, req->objcore, OA_GZIPBITS, &dl); p = ObjGetAttr(req->wrk, req->objcore, OA_GZIPBITS, &dl);
if (p == NULL || dl != 32) if (p != NULL || dl == 32) {
return (0); /* No OA_GZIPBITS yet */ u = vbe64dec(p + 24);
/*
u = vbe64dec(p + 24); * If the size is non-zero AND we are the top VDP
/* * (ie: no ESI), we know what size the output will be.
* If the size is non-zero AND we are the top */
* VDP (ie: no ESI), we know what size the output will be. if (u != 0 &&
*/ VTAILQ_FIRST(&req->vdc->vdp)->vdp == &VDP_gunzip)
if (u != 0 && VTAILQ_FIRST(&req->vdc->vdp)->vdp == &VDP_gunzip) req->resp_len = u;
req->resp_len = u; }
return (0); return (0);
} }
......
...@@ -3,7 +3,17 @@ varnishtest "test gunzip for client + Range" ...@@ -3,7 +3,17 @@ varnishtest "test gunzip for client + Range"
server s1 -repeat 3 { server s1 -repeat 3 {
rxreq rxreq
expect req.http.accept-encoding == "gzip" expect req.http.accept-encoding == "gzip"
txresp -gzipbody FOOBARBARF txresp -nolen -hdr "Transfer-encoding: chunked" \
-hdr "Content-encoding: gzip"
delay 1
# Compressed "FOOBARBARF"
sendhex {
31 43 0d 0a
1f 8b 08 00 75 96 cc 5a 02 03 73 f3 f7 77 72 0c
02 22 37 00 06 8e 8c 83 0a 00 00 00
0d 0a
30 0d 0a 0d 0a
}
} -start } -start
varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend { varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
...@@ -21,33 +31,49 @@ client c1 { ...@@ -21,33 +31,49 @@ client c1 {
expect resp.status == 200 expect resp.status == 200
expect resp.bodylen == "10" expect resp.bodylen == "10"
expect resp.http.content-encoding == <undef> expect resp.http.content-encoding == <undef>
} -run
varnish v1 -vsl_catchup
client c1 {
txreq -hdr "Accept-encoding: gzip;q=0.1" txreq -hdr "Accept-encoding: gzip;q=0.1"
rxresp rxresp
expect resp.http.content-encoding == "gzip" expect resp.http.content-encoding == "gzip"
gunzip gunzip
expect resp.bodylen == "10" expect resp.bodylen == "10"
} -run
# This delay attempts to ensure that the busyobj varnish v1 -vsl_catchup
# is completed before we attempt the range request
delay 1 # This delay attempts to ensure that the busyobj
# is completed before we attempt the range request
delay 2
client c1 {
txreq -hdr "Range: bytes=3-5" txreq -hdr "Range: bytes=3-5"
rxresp rxresp
expect resp.status == 206 expect resp.status == 206
expect resp.http.content-encoding == "<undef>" expect resp.http.content-encoding == "<undef>"
expect resp.bodylen == "3" expect resp.bodylen == "3"
expect resp.body == "BAR" expect resp.body == "BAR"
} -run
varnish v1 -vsl_catchup
client c1 {
txreq -url "/nostreamcachemiss" -hdr "Range: bytes=3-5" txreq -url "/nostreamcachemiss" -hdr "Range: bytes=3-5"
rxresp rxresp
expect resp.status == 206 expect resp.status == 206
expect resp.http.content-encoding == "<undef>" expect resp.http.content-encoding == "<undef>"
expect resp.bodylen == "3" expect resp.bodylen == "3"
expect resp.body == "BAR" expect resp.body == "BAR"
} -run
varnish v1 -vsl_catchup
# simple cache miss no gunzip client c1 {
txreq -url "/2" -hdr "Range: bytes=3-5" -hdr "Accept-Encoding: gzip" # simple cache miss, no stream, no gunzip
txreq -url "/nostream2" -hdr "Range: bytes=3-5" -hdr "Accept-Encoding: gzip"
rxresp rxresp
expect resp.status == 206 expect resp.status == 206
expect resp.http.content-encoding == "gzip" expect resp.http.content-encoding == "gzip"
......
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