[master] 07ad2fb86 Normalize esi:include -- CNT interaction even more

Poul-Henning Kamp phk at FreeBSD.org
Thu Dec 13 10:13:11 UTC 2018


commit 07ad2fb863b7db12e94449e11d47a1eefb2dd359
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Dec 12 00:12:40 2018 +0000

    Normalize esi:include -- CNT interaction even more

diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index 4bc9cd098..fdc3e798d 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -201,7 +201,7 @@ ved_include(struct req *preq, const char *src, const char *host,
 	req->wrk = NULL;
 	THR_SetRequest(preq);
 
-	Req_AcctLogCharge(wrk->stats, req);
+	Req_Cleanup(sp, wrk, req);
 	Req_Release(req);
 }
 
diff --git a/bin/varnishd/cache/cache_req.c b/bin/varnishd/cache/cache_req.c
index d16f550c4..bc1f6152d 100644
--- a/bin/varnishd/cache/cache_req.c
+++ b/bin/varnishd/cache/cache_req.c
@@ -63,7 +63,11 @@ Req_AcctLogCharge(struct VSC_main_wrk *ds, struct req *req)
 		    (uintmax_t)(a->resp_hdrbytes + a->resp_bodybytes));
 	}
 
-	/* Charge to main byte counters (except for ESI subrequests) */
+	/*
+	 * Charge to main byte counters, except for ESI subrequests
+	 * which are charged as they pass through the topreq.
+	 * XXX: make this test req->top instead
+	 */
 #define ACCT(foo)			\
 	if (req->esi_level == 0)	\
 		ds->s_##foo += a->foo;	\
@@ -214,7 +218,6 @@ Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req)
 	req->restarts = 0;
 	req->top = 0;
 
-	AZ(req->esi_level);
 	AZ(req->privs->magic);
 
 	if (req->vcl != NULL)
@@ -239,6 +242,7 @@ Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req)
 
 	req->hash_always_miss = 0;
 	req->hash_ignore_busy = 0;
+	req->esi_level = 0;
 	req->is_hit = 0;
 
 	if (WS_Overflowed(req->ws))


More information about the varnish-commit mailing list