[master] 780e52f Don't emit output duing init/open

Poul-Henning Kamp phk at FreeBSD.org
Wed Jul 9 19:58:23 CEST 2014


commit 780e52f312f8a2c5759ab545c8f6adcd934e5b6e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jul 9 17:57:51 2014 +0000

    Don't emit output duing init/open

diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c
index 66d3420..e17ac52 100644
--- a/bin/varnishd/cache/cache_esi_parse.c
+++ b/bin/varnishd/cache/cache_esi_parse.c
@@ -578,9 +578,20 @@ VEP_Parse(struct vep_state *vep, const struct busyobj *bo, const char *p,
 	CHECK_OBJ_NOTNULL(vep, VEP_MAGIC);
 	assert(l > 0);
 
-	/* XXX: Really need to fix this */
-	if (vep->hack_p == NULL)
+	if (vep->startup) {
+		/*
+		 * We must force the GZIP header out as a SKIP string,
+		 * otherwise an object starting with <esi:include would
+		 * have its GZIP header appear after the included object
+		 * (e000026.vtc)
+		 */
+		vep->ver_p = "";
+		vep->last_mark = SKIP;
+		vep_mark_common(vep, vep->ver_p, VERBATIM);
+		vep->startup = 0;
+		AZ(vep->hack_p);
 		vep->hack_p = p;
+	}
 
 	vep->ver_p = p;
 
@@ -1059,16 +1070,7 @@ VEP_Init(struct busyobj *bo, vep_callback_t *cb, void *cb_priv)
 	vep->crc = crc32(0L, Z_NULL, 0);
 	vep->crcp = crc32(0L, Z_NULL, 0);
 
-	/*
-	 * We must force the GZIP header out as a SKIP string, otherwise
-	 * an object starting with <esi:include would have its GZIP header
-	 * appear after the included object (e000026.vtc)
-	 */
 	vep->startup = 1;
-	vep->ver_p = "";
-	vep->last_mark = SKIP;
-	vep_mark_common(vep, vep->ver_p, VERBATIM);
-	vep->startup = 0;
 	return (vep);
 }
 



More information about the varnish-commit mailing list