[master] dec9455 Fix for an issue where varnishlog reports an incorrect "Length" entry on gunzipped delivery

Dag Haavi Finstad daghf at varnish-cache.org
Thu Jul 5 14:37:16 CEST 2012


commit dec9455a9f0bb1b1e3c5b65d3d626d531db25fbb
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date:   Mon Jul 2 09:50:30 2012 +0200

    Fix for an issue where varnishlog reports an incorrect "Length" entry on gunzipped delivery

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 1a42bd0..6c46831 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -823,7 +823,7 @@ void VGZ_UpdateObj(const struct vgz*, struct object *);
 int VGZ_WrwInit(struct vgz *vg);
 int VGZ_WrwGunzip(struct worker *w, struct vgz *, const void *ibuf,
     ssize_t ibufl);
-void VGZ_WrwFlush(const struct worker *wrk, struct vgz *vg);
+void VGZ_WrwFlush(struct worker *wrk, struct vgz *vg);
 
 /* Return values */
 #define VGZ_ERROR	-1
diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index 9078834..1ebabb0 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -355,13 +355,15 @@ VGZ_WrwGunzip(struct worker *wrk, struct vgz *vg, const void *ibuf,
 /*--------------------------------------------------------------------*/
 
 void
-VGZ_WrwFlush(const struct worker *wrk, struct vgz *vg)
+VGZ_WrwFlush(struct worker *wrk, struct vgz *vg)
 {
 	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
 	CHECK_OBJ_NOTNULL(vg, VGZ_MAGIC);
 
 	if (vg->m_len ==  0)
 		return;
+
+	wrk->acct_tmp.bodybytes += vg->m_len;
 	(void)WRW_Write(wrk, vg->m_buf, vg->m_len);
 	(void)WRW_Flush(wrk);
 	vg->m_len = 0;



More information about the varnish-commit mailing list