[4.1] 2367d52 The actual fix for #1781

Poul-Henning Kamp phk at FreeBSD.org
Thu Sep 10 14:37:28 CEST 2015


commit 2367d528ab370381a6d94551136aa18e977f2716
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Sep 9 19:36:44 2015 +0000

    The actual fix for #1781
    
    See previous commit.

diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index ff30ae3..5649769 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -228,7 +228,7 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
 	uint32_t icrc = 0;
 	uint8_t tailbuf[8 + 5];
 	const uint8_t *pp;
-	struct ecx *ecx;
+	struct ecx *ecx, *pecx;
 	int retval = 0;
 
 	if (act == VDP_INIT) {
@@ -360,6 +360,13 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
 
 				(void)VDP_bytes(req, VDP_NULL, tailbuf, 13);
 			}
+			if (req->transport->deliver == VED_Deliver) {
+				CAST_OBJ_NOTNULL(pecx, req->transport_priv,
+				    ECX_MAGIC);
+				pecx->crc = crc32_combine(pecx->crc,
+				    ecx->crc, ecx->l_crc);
+				pecx->l_crc += ecx->l_crc;
+			}
 			retval = VDP_bytes(req, VDP_FLUSH, NULL, 0);
 			ecx->state = 99;
 			return (retval);



More information about the varnish-commit mailing list