[master] cc295cf A little bit more libvgz coverage
Poul-Henning Kamp
phk at FreeBSD.org
Sun May 21 23:23:05 CEST 2017
commit cc295cf0bd0dff9e5e4eb8f193fef90dd9205199
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Sun May 21 21:22:27 2017 +0000
A little bit more libvgz coverage
diff --git a/bin/varnishtest/tests/g00001.vtc b/bin/varnishtest/tests/g00001.vtc
index 0f84f54..4d0cfe1 100644
--- a/bin/varnishtest/tests/g00001.vtc
+++ b/bin/varnishtest/tests/g00001.vtc
@@ -3,7 +3,13 @@ varnishtest "test basic gunzip for client"
server s1 {
rxreq
expect req.http.accept-encoding == "gzip"
- txresp -gzipbody FOO
+ txresp -nolen -hdr "Content-Length: 49" -hdr "Content-Encoding: gzip"
+
+ # "date > _ ; gzip -9 _" - contains filename + timestamp
+ sendhex "1f 8b 08 08 ef 00 22 59 02 03 5f 00 0b 2e cd 53"
+ sendhex "f0 4d ac 54 30 32 04 22 2b 03 13 2b 13 73 85 d0"
+ sendhex "10 67 05 23 03 43 73 2e 00 cf 9b db c0 1d 00 00"
+ sendhex "00"
} -start
varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
@@ -12,26 +18,26 @@ varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
client c1 {
txreq
rxresp
- expect resp.bodylen == "3"
+ expect resp.bodylen == "29"
expect resp.http.content-encoding == <undef>
txreq -hdr "Accept-encoding: gzip;q=0.1"
rxresp
expect resp.http.content-encoding == "gzip"
gunzip
- expect resp.bodylen == "3"
+ expect resp.bodylen == "29"
} -run
-delay .1
+varnish v1 -vsl_catchup
client c1 {
txreq -proto HTTP/1.0
rxresp
- expect resp.bodylen == "3"
+ expect resp.bodylen == "29"
expect resp.http.content-encoding == <undef>
} -run
-delay .1
+varnish v1 -vsl_catchup
client c1 {
txreq -req HEAD
@@ -40,7 +46,7 @@ client c1 {
txreq -req HEAD -hdr "Accept-encoding: gzip;q=0.1"
rxresp -no_obj
- expect resp.http.content-length == "26"
+ expect resp.http.content-length == "49"
expect resp.http.content-encoding == "gzip"
} -run
diff --git a/lib/libvgz/deflate.c b/lib/libvgz/deflate.c
index ba50571..4fce32a 100644
--- a/lib/libvgz/deflate.c
+++ b/lib/libvgz/deflate.c
@@ -1118,7 +1118,7 @@ int ZEXPORT deflateEnd (strm)
return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
}
-#ifdef NOVGZ
+#ifdef NOVGZ
/* =========================================================================
* Copy the source state to the destination state.
More information about the varnish-commit
mailing list