[master] 4c1625d Give VDP_push() a string ID argument for debugging.

Poul-Henning Kamp phk at FreeBSD.org
Tue Mar 29 15:40:04 CEST 2016


commit 4c1625d8b7083f6a5f86333aa8a67cdf0ba3fc11
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Mar 29 09:42:28 2016 +0000

    Give VDP_push() a string ID argument for debugging.

diff --git a/bin/varnishd/cache/cache_deliver_proc.c b/bin/varnishd/cache/cache_deliver_proc.c
index 343852d..f61cfb3 100644
--- a/bin/varnishd/cache/cache_deliver_proc.c
+++ b/bin/varnishd/cache/cache_deliver_proc.c
@@ -56,7 +56,8 @@ VDP_bytes(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
 }
 
 void
-VDP_push(struct req *req, vdp_bytes *func, void *priv, int bottom)
+VDP_push(struct req *req, vdp_bytes *func, void *priv, int bottom,
+    const char *id)
 {
 	struct vdp_entry *vdp;
 
@@ -79,6 +80,7 @@ VDP_push(struct req *req, vdp_bytes *func, void *priv, int bottom)
 	INIT_OBJ(vdp, VDP_ENTRY_MAGIC);
 	vdp->func = func;
 	vdp->priv = priv;
+	vdp->id = id;
 	if (bottom)
 		VTAILQ_INSERT_TAIL(&req->vdp, vdp, list);
 	else
diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index ec8c309..0dde0b6 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -778,9 +778,9 @@ VED_Deliver(struct req *req, struct boc *boc, int wantbody)
 		ved_stripgzip(req, boc);
 	} else {
 		if (ecx->isgzip && !i)
-			VDP_push(req, ved_pretend_gzip, ecx, 1);
+			VDP_push(req, ved_pretend_gzip, ecx, 1, "PGZ");
 		else
-			VDP_push(req, ved_vdp_bytes, ecx->preq, 1);
+			VDP_push(req, ved_vdp_bytes, ecx->preq, 1, "VED");
 		(void)VDP_DeliverObj(req);
 		(void)VDP_bytes(req, VDP_FLUSH, NULL, 0);
 	}
diff --git a/bin/varnishd/cache/cache_filter.h b/bin/varnishd/cache/cache_filter.h
index 3ffed7e..064c94f 100644
--- a/bin/varnishd/cache/cache_filter.h
+++ b/bin/varnishd/cache/cache_filter.h
@@ -103,11 +103,13 @@ struct vdp_entry {
 #define VDP_ENTRY_MAGIC		0x353eb781
 	vdp_bytes		*func;
 	void			*priv;
+	const char		*id;
 	VTAILQ_ENTRY(vdp_entry)	list;
 };
 
 int VDP_bytes(struct req *, enum vdp_action act, const void *ptr, ssize_t len);
-void VDP_push(struct req *, vdp_bytes *func, void *priv, int bottom);
+void VDP_push(struct req *, vdp_bytes *func, void *priv, int bottom,
+    const char *id);
 void VDP_close(struct req *req);
 int VDP_DeliverObj(struct req *req);
 
diff --git a/bin/varnishd/cache/cache_range.c b/bin/varnishd/cache/cache_range.c
index 6c053fc..8b3e0f1 100644
--- a/bin/varnishd/cache/cache_range.c
+++ b/bin/varnishd/cache/cache_range.c
@@ -169,7 +169,7 @@ vrg_dorange(struct req *req, const char *r)
 	vrg_priv->range_off = 0;
 	vrg_priv->range_low = low;
 	vrg_priv->range_high = high + 1;
-	VDP_push(req, vrg_range_bytes, vrg_priv, 1);
+	VDP_push(req, vrg_range_bytes, vrg_priv, 1, "RNG");
 	http_PutResponse(req->resp, "HTTP/1.1", 206, NULL);
 	return (NULL);
 }
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 94f893b..03c8b2e 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -269,12 +269,12 @@ cnt_transmit(struct worker *wrk, struct req *req)
 	if (sendbody >= 0) {
 		if (!req->disable_esi && req->resp_len != 0 &&
 		    ObjHasAttr(wrk, req->objcore, OA_ESIDATA))
-			VDP_push(req, VDP_ESI, NULL, 0);
+			VDP_push(req, VDP_ESI, NULL, 0, "ESI");
 
 		if (cache_param->http_gzip_support &&
 		    ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED) &&
 		    !RFC2616_Req_Gzip(req->http))
-			VDP_push(req, VDP_gunzip, NULL, 1);
+			VDP_push(req, VDP_gunzip, NULL, 1, "GUZ");
 
 		if (cache_param->http_range_support &&
 		    http_IsStatus(req->resp, 200)) {
diff --git a/bin/varnishd/http1/cache_http1_deliver.c b/bin/varnishd/http1/cache_http1_deliver.c
index 3af9f48..0833f49 100644
--- a/bin/varnishd/http1/cache_http1_deliver.c
+++ b/bin/varnishd/http1/cache_http1_deliver.c
@@ -112,7 +112,7 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
 		http_SetHeader(req->resp, "Connection: keep-alive");
 
 	if (sendbody && req->resp_len != 0)
-		VDP_push(req, v1d_bytes, NULL, 1);
+		VDP_push(req, v1d_bytes, NULL, 1, "V1B");
 
 	AZ(req->wrk->v1l);
 	V1L_Reserve(req->wrk, req->ws, &req->sp->fd, req->vsl, req->t_prev);



More information about the varnish-commit mailing list