[master] 21eb6a170 Save VPI_count() info to struct wrk_vpi

Nils Goroll nils.goroll at uplex.de
Mon Aug 15 13:38:06 UTC 2022


commit 21eb6a1700ea0c7a5726d27b14c2908aee714b62
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Feb 9 12:51:49 2021 +0100

    Save VPI_count() info to struct wrk_vpi
    
    So we have it available for Panics in a follow-up commit

diff --git a/bin/varnishd/cache/cache_vpi.c b/bin/varnishd/cache/cache_vpi.c
index 302523c39..e22cc6377 100644
--- a/bin/varnishd/cache/cache_vpi.c
+++ b/bin/varnishd/cache/cache_vpi.c
@@ -67,6 +67,7 @@ VPI_count(VRT_CTX, unsigned u)
 	CHECK_OBJ_NOTNULL(ctx->vcl, VCL_MAGIC);
 	CHECK_OBJ_NOTNULL(ctx->vcl->conf, VCL_CONF_MAGIC);
 	assert(u < ctx->vcl->conf->nref);
+	ctx->vpi->ref = u;
 	if (ctx->vsl != NULL)
 		VSLb(ctx->vsl, SLT_VCL_trace, "%s %u %u.%u.%u",
 		    ctx->vcl->loaded_name, u, ctx->vcl->conf->ref[u].source,
diff --git a/include/vcc_interface.h b/include/vcc_interface.h
index 4a51868cd..394f308a0 100644
--- a/include/vcc_interface.h
+++ b/include/vcc_interface.h
@@ -58,6 +58,7 @@ struct wrk_vpi {
 	unsigned	magic;
 #define WRK_VPI_MAGIC	0xaa3d3df3
 	unsigned	handling;
+	unsigned	ref;	// index into (struct vpi_ref)[]
 };
 
 


More information about the varnish-commit mailing list