[master] 980243c Don't panic on incomplete VDP::gunzip, the backend may have abandonned us.
Poul-Henning Kamp
phk at FreeBSD.org
Mon Nov 10 10:27:56 CET 2014
commit 980243cbc53faa5f28fda402dee09bcec47c2bcf
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Nov 10 09:27:18 2014 +0000
Don't panic on incomplete VDP::gunzip, the backend may have
abandonned us.
Fixes #1624
diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index 1afd3cb..1762815 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -310,8 +310,8 @@ VDP_gunzip(struct req *req, enum vdp_action act, void **priv,
AN(vg->m_buf);
if (act == VDP_FINI) {
+ /* NB: Gunzip'ing may or may not have completed successfully. */
AZ(len);
- AZ(vg->m_len);
(void)VGZ_Destroy(&vg);
*priv = NULL;
return (0);
diff --git a/bin/varnishtest/tests/r01624.vtc b/bin/varnishtest/tests/r01624.vtc
new file mode 100644
index 0000000..23fefc0
--- /dev/null
+++ b/bin/varnishtest/tests/r01624.vtc
@@ -0,0 +1,40 @@
+varnishtest "broken gunzip delivery"
+
+server s1 {
+ rxreq
+ txresp -nolen \
+ -hdr "Content-Encoding: gzip" \
+ -hdr "Transfer-Encoding: Chunked"
+ send "164\r\n"
+ sendhex "1f 8b 08 00 f3 7e 60 54 00 03 9d 94 d1 6e 82 30"
+ sendhex "14 86 ef fb 14 ff 23 70 0e 28 7a 69 b2 78 61 e2"
+ sendhex "76 c1 92 5d a3 69 e6 12 27 a6 b3 4b f6 f6 93 a3"
+ sendhex "24 a5 2d 16 e9 0d f0 51 4e db bf 1f 05 52 8d 33"
+ sendhex "2a 54 7b b3 a9 4f b6 36 7f ce ab b5 de 99 3e da"
+ sendhex "d6 66 7f e8 7d be 3a 9b af 63 8f a8 6d 23 d7 39"
+ sendhex "28 bf 56 07 97 dd 9b 1c 94 81 4a 70 11 21 39 09"
+ # Truncated
+ delay .2
+
+ accept
+ rxreq
+ txresp -bodylen 7
+} -start
+
+varnish v1 -vcl+backend {} -start
+
+client c1 {
+ txreq
+ non-fatal
+ timeout 3
+ rxresp
+} -run
+
+delay .2
+
+client c1 {
+ # Test varnishd is still running
+ txreq -url /2
+ rxresp
+ expect resp.bodylen == 7
+} -run
More information about the varnish-commit
mailing list