[master] 99016d84b Move pan_vdp() to VDP_Panic()

Poul-Henning Kamp phk at FreeBSD.org
Tue Oct 27 22:18:08 UTC 2020


commit 99016d84b8080d55e3c5ce02122aff56b52649ef
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Oct 27 17:31:55 2020 +0000

    Move pan_vdp() to VDP_Panic()

diff --git a/bin/varnishd/cache/cache_deliver_proc.c b/bin/varnishd/cache/cache_deliver_proc.c
index 076532bcf..1b871bd49 100644
--- a/bin/varnishd/cache/cache_deliver_proc.c
+++ b/bin/varnishd/cache/cache_deliver_proc.c
@@ -34,6 +34,33 @@
 #include "cache_varnishd.h"
 #include "cache_filter.h"
 
+void
+VDP_Panic(struct vsb *vsb, const struct vdp_ctx *vdc)
+{
+	struct vdp_entry *vde;
+
+	VSB_printf(vsb, "vdc = %p {\n", vdc);
+	VSB_indent(vsb, 2);
+	PAN_CheckMagic(vsb, vdc, VDP_CTX_MAGIC);
+	VSB_printf(vsb, "nxt = %p,\n", vdc->nxt);
+	VSB_printf(vsb, "retval = %d,\n", vdc->retval);
+
+	if (!VTAILQ_EMPTY(&vdc->vdp)) {
+		VSB_cat(vsb, "filters = {\n");
+		VSB_indent(vsb, 2);
+		VTAILQ_FOREACH(vde, &vdc->vdp, list)
+			VSB_printf(vsb, "%s = %p { priv = %p }\n",
+			    vde->vdp->name, vde, vde->priv);
+		VSB_indent(vsb, -2);
+		VSB_cat(vsb, "},\n");
+	}
+
+	VSB_indent(vsb, -2);
+	VSB_cat(vsb, "},\n");
+}
+
+
+
 void
 VDP_Init(struct vdp_ctx *vdc, struct worker *wrk, struct vsl_log *vsl,
     struct req *req)
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index abd637e2f..c0443ebed 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -344,31 +344,6 @@ pan_vfp(struct vsb *vsb, const struct vfp_ctx *vfc)
 	VSB_cat(vsb, "},\n");
 }
 
-static void
-pan_vdp(struct vsb *vsb, const struct vdp_ctx *vdc)
-{
-	struct vdp_entry *vde;
-
-	VSB_printf(vsb, "vdc = %p {\n", vdc);
-	VSB_indent(vsb, 2);
-	PAN_CheckMagic(vsb, vdc, VDP_CTX_MAGIC);
-	VSB_printf(vsb, "nxt = %p,\n", vdc->nxt);
-	VSB_printf(vsb, "retval = %d,\n", vdc->retval);
-
-	if (!VTAILQ_EMPTY(&vdc->vdp)) {
-		VSB_cat(vsb, "filters = {\n");
-		VSB_indent(vsb, 2);
-		VTAILQ_FOREACH(vde, &vdc->vdp, list)
-			VSB_printf(vsb, "%s = %p { priv = %p }\n",
-			    vde->vdp->name, vde, vde->priv);
-		VSB_indent(vsb, -2);
-		VSB_cat(vsb, "},\n");
-	}
-
-	VSB_indent(vsb, -2);
-	VSB_cat(vsb, "},\n");
-}
-
 static void
 pan_busyobj(struct vsb *vsb, const struct busyobj *bo)
 {
@@ -502,7 +477,7 @@ pan_req(struct vsb *vsb, const struct req *req)
 	if (req->resp != NULL && req->resp->ws != NULL)
 		pan_http(vsb, "resp", req->resp);
 	if (req->vdc != NULL)
-		pan_vdp(vsb, req->vdc);
+		VDP_Panic(vsb, req->vdc);
 
 	VCL_Panic(vsb, "vcl", req->vcl);
 
diff --git a/bin/varnishd/cache/cache_varnishd.h b/bin/varnishd/cache/cache_varnishd.h
index 385c38e0d..6446699e2 100644
--- a/bin/varnishd/cache/cache_varnishd.h
+++ b/bin/varnishd/cache/cache_varnishd.h
@@ -173,6 +173,9 @@ void VDI_Panic(const struct director *, struct vsb *, const char *nm);
 void VDI_Event(const struct director *d, enum vcl_event_e ev);
 void VDI_Init(void);
 
+/* cache_deliver_proc.c */
+void VDP_Panic(struct vsb *vsb, const struct vdp_ctx *vdc);
+
 /* cache_exp.c */
 vtim_real EXP_Ttl(const struct req *, const struct objcore *);
 vtim_real EXP_Ttl_grace(const struct req *, const struct objcore *oc);


More information about the varnish-commit mailing list