[master] 3470a286a Properly generate VDP_END for gunzip

Nils Goroll nils.goroll at uplex.de
Fri Oct 9 08:38:06 UTC 2020


commit 3470a286a5af9406b538b095eb6c46872cb4c759
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Oct 8 16:22:00 2020 +0200

    Properly generate VDP_END for gunzip

diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index b5c04db83..47dad1e52 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -386,7 +386,8 @@ vdp_gunzip_bytes(struct vdp_ctx *vdx, enum vdp_action act, void **priv,
 		if (vr < VGZ_OK)
 			return (-1);
 		if (vg->m_len == vg->m_sz || vr != VGZ_OK) {
-			if (VDP_bytes(vdx, VDP_FLUSH, vg->m_buf, vg->m_len))
+			if (VDP_bytes(vdx, vr == VGZ_END ? VDP_END : VDP_FLUSH,
+			    vg->m_buf, vg->m_len))
 				return (vdx->retval);
 			vg->m_len = 0;
 			VGZ_Obuf(vg, vg->m_buf, vg->m_sz);
diff --git a/bin/varnishtest/tests/g00002.vtc b/bin/varnishtest/tests/g00002.vtc
index 6afddd8d9..8b83b815b 100644
--- a/bin/varnishtest/tests/g00002.vtc
+++ b/bin/varnishtest/tests/g00002.vtc
@@ -18,9 +18,15 @@ varnish v1 \
 	-cliok "param.set gzip_memlevel 1" \
 	-vcl+backend {
 
+	import debug;
+
 	sub vcl_backend_response {
 		set beresp.do_esi = true;
 	}
+
+	sub vcl_deliver {
+		set resp.filters += " debug.pedantic";
+	}
 } -start
 
 varnish v1 -cliok "param.set fetch_chunksize 4k"
diff --git a/bin/varnishtest/tests/m00048.vtc b/bin/varnishtest/tests/m00048.vtc
index 3b2c3d78c..f67f72a23 100644
--- a/bin/varnishtest/tests/m00048.vtc
+++ b/bin/varnishtest/tests/m00048.vtc
@@ -66,7 +66,7 @@ varnish v1 -vcl+backend {
 
 	sub vcl_deliver {
 		if (req.http.Rot13) {
-			set resp.filters = "rot13";
+			set resp.filters = "rot13 debug.pedantic";
 		}
 	}
 }


More information about the varnish-commit mailing list