[master] f3c42c374 Assert that dynamic privs hang off a single vcl
Nils Goroll
nils.goroll at uplex.de
Tue Oct 30 16:52:07 UTC 2018
commit f3c42c37454dacd61214c5e89f309348faa3d6ab
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Tue Oct 30 17:46:49 2018 +0100
Assert that dynamic privs hang off a single vcl
we could also retire the vcl member of struct vrt_priv, but it could
be useful for debugging.
diff --git a/bin/varnishd/cache/cache_vrt_priv.c b/bin/varnishd/cache/cache_vrt_priv.c
index e4dd16479..e150ee4ac 100644
--- a/bin/varnishd/cache/cache_vrt_priv.c
+++ b/bin/varnishd/cache/cache_vrt_priv.c
@@ -102,9 +102,10 @@ vrt_priv_dynamic(const struct vcl *vcl, struct ws *ws,
VTAILQ_FOREACH(vp, &vps->privs, list) {
CHECK_OBJ_NOTNULL(vp, VRT_PRIV_MAGIC);
- if (vp->vcl == vcl && vp->id == id &&
- vp->vmod_id == vmod_id)
+ if (vp->id == id && vp->vmod_id == vmod_id) {
+ assert(vp->vcl == vcl);
return (vp->priv);
+ }
}
vp = WS_Alloc(ws, sizeof *vp);
if (vp == NULL)
More information about the varnish-commit
mailing list