Mailing List Archive

[6.0] 2d666b033 make VFP_Close() idempotent
commit 2d666b03337356a680a4235fd2ce6224af5613ec
Author: Nils Goroll <nils.goroll@uplex.de>
Date: Wed Oct 2 16:42:46 2019 +0200

make VFP_Close() idempotent

required for #3009

diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
index 1413f1bbd..9bc59bf2f 100644
--- a/bin/varnishd/cache/cache_fetch_proc.c
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -118,13 +118,14 @@ VFP_Setup(struct vfp_ctx *vc, struct worker *wrk)
void
VFP_Close(struct vfp_ctx *vc)
{
- struct vfp_entry *vfe;
+ struct vfp_entry *vfe, *tmp;

- VTAILQ_FOREACH(vfe, &vc->vfp, list) {
+ VTAILQ_FOREACH_SAFE(vfe, &vc->vfp, list, tmp) {
if (vfe->vfp->fini != NULL)
vfe->vfp->fini(vc, vfe);
VSLb(vc->wrk->vsl, SLT_VfpAcct, "%s %ju %ju", vfe->vfp->name,
(uintmax_t)vfe->calls, (uintmax_t)vfe->bytes_out);
+ VTAILQ_REMOVE(&vc->vfp, vfe, list);
}
}

_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit