Move the call RES_StreamPoll after the testgzip, because the RES_StreamPoll may destroy the store during pass or hit_for_pass.

Jammy jammy.linux at gmail.com
Mon Nov 12 07:27:45 CET 2012



Issue:  https://www.varnish-cache.org/trac/ticket/1220

The fix:  Move the call RES_StreamPoll after the testgzip, because the RES_StreamPoll may destroy the store during pass or hit_for_pass.



From 43459e5dd1acdc74f40efc3e507ee0035592fd54 Mon Sep 17 00:00:00 2001
From: ijammy <mzhang at yottaa.com>
Date: Mon, 12 Nov 2012 14:19:13 +0800
Subject: [PATCH] Move the call RES_StreamPoll after the testgzip, because the
stream poll may destroy the store during pass or
hit_for_pass

---
bin/varnishd/cache_gzip.c |    6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/varnishd/cache_gzip.c b/bin/varnishd/cache_gzip.c
index 07bdcac..165163b 100644
--- a/bin/varnishd/cache_gzip.c
+++ b/bin/varnishd/cache_gzip.c
@@ -647,8 +647,6 @@ vfp_testgzip_bytes(struct sess *sp, struct http_conn *htc, ssize_t bytes)
		VGZ_Ibuf(vg, st->ptr + st->len, w);
		st->len += w;
		sp->obj->len += w;
-		if (sp->wrk->do_stream)
-			RES_StreamPoll(sp);

		while (!VGZ_IbufEmpty(vg)) {
			VGZ_Obuf(vg, obuf, sizeof obuf);
@@ -660,6 +658,10 @@ vfp_testgzip_bytes(struct sess *sp, struct http_conn *htc, ssize_t bytes)
				   "Invalid Gzip data", vg->vz.msg));

		}
+
+		if (sp->wrk->do_stream)
+			RES_StreamPoll(sp);
+
	}
	assert(i == VGZ_OK || i == VGZ_END);
	return (1);
-- 
1.7.10.2 (Apple Git-33)



----------------------------------
Best wishes,
Jammy






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20121112/360df4f8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Move-the-call-RES_StreamPoll-after-the-testgzip-beca.patch
Type: application/octet-stream
Size: 1121 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20121112/360df4f8/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20121112/360df4f8/attachment-0001.html>


More information about the varnish-dev mailing list