[master] 1054aed Add the ungzip'ed length of verbatim sequences to the VEC string so we can combine the CRC32 values.

Poul-Henning Kamp phk at project.varnish-software.com
Fri Jan 21 15:30:23 CET 2011


commit 1054aede3663867189dd8c4160bb54dc9b475a52
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Jan 21 14:29:44 2011 +0000

    Add the ungzip'ed length of verbatim sequences to the VEC string
    so we can combine the CRC32 values.

diff --git a/bin/varnishd/cache_esi.h b/bin/varnishd/cache_esi.h
index ad97b46..1e15d6b 100644
--- a/bin/varnishd/cache_esi.h
+++ b/bin/varnishd/cache_esi.h
@@ -30,6 +30,9 @@
 #define	VEC_V1	(0x40 + 1)
 #define	VEC_V2	(0x40 + 2)
 #define	VEC_V8	(0x40 + 8)
+#define	VEC_C1	(0x50 + 1)
+#define	VEC_C2	(0x50 + 2)
+#define	VEC_C8	(0x50 + 8)
 #define	VEC_S1	(0x60 + 1)
 #define	VEC_S2	(0x60 + 2)
 #define	VEC_S8	(0x60 + 8)
diff --git a/bin/varnishd/cache_esi_deliver.c b/bin/varnishd/cache_esi_deliver.c
index e4016c6..6a344ec 100644
--- a/bin/varnishd/cache_esi_deliver.c
+++ b/bin/varnishd/cache_esi_deliver.c
@@ -174,7 +174,7 @@ ESI_Deliver(struct sess *sp)
 	struct storage *st;
 	uint8_t *p, *e, *q, *r;
 	unsigned off;
-	ssize_t l;
+	ssize_t l, l_crc;
 	uint32_t crc, crc_ref;
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
@@ -192,6 +192,8 @@ ESI_Deliver(struct sess *sp)
 		case VEC_V2:
 		case VEC_V8:
 			l = ved_decode_len(&p);
+			assert(*p == VEC_C1 || *p == VEC_C2 || *p == VEC_C8);
+			l_crc = ved_decode_len(&p);
 			crc = vbe32dec(p);
 			p += 4;
 			q = (void*)strchr((const char*)p, '\0');
diff --git a/bin/varnishd/cache_esi_parse.c b/bin/varnishd/cache_esi_parse.c
index 1325a74..2a3edea 100644
--- a/bin/varnishd/cache_esi_parse.c
+++ b/bin/varnishd/cache_esi_parse.c
@@ -280,6 +280,7 @@ vep_emit_verbatim(const struct vep_state *vep, ssize_t l)
 		Debug("---> VERBATIM(%jd)\n", (intmax_t)l);
 	}
 	vep_emit_len(vep, l, VEC_V1, VEC_V2, VEC_V8);
+	vep_emit_len(vep, l, VEC_C1, VEC_C2, VEC_C8);
 	vbe32enc(buf, vep->crc);
 	vsb_bcat(vep->vsb, buf, sizeof buf);
 	vsb_printf(vep->vsb, "%lx\r\n%c", l, 0);



More information about the varnish-commit mailing list