[master] f5982ebd6 Dont trust the vcl list to be tsorted.

Poul-Henning Kamp phk at FreeBSD.org
Tue May 28 09:08:12 UTC 2019


commit f5982ebd68aef144d52c0e7ad2b7513d91a2f95f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue May 28 06:43:35 2019 +0000

    Dont trust the vcl list to be tsorted.

diff --git a/bin/varnishd/mgt/mgt_vcl.c b/bin/varnishd/mgt/mgt_vcl.c
index 1e9c6939d..f78d1887f 100644
--- a/bin/varnishd/mgt/mgt_vcl.c
+++ b/bin/varnishd/mgt/mgt_vcl.c
@@ -921,10 +921,10 @@ mgt_vcl_atexit(void)
 	if (getpid() != heritage.mgt_pid)
 		return;
 	active_vcl = NULL;
-	VTAILQ_FOREACH_REVERSE_SAFE(vp, &vclhead, vclproghead, list, vp2) {
-		assert(VTAILQ_EMPTY(&vp->dto));
-		mgt_vcl_del(vp);
-	}
+	while (!VTAILQ_EMPTY(&vclhead))
+		VTAILQ_FOREACH_SAFE(vp, &vclhead, list, vp2)
+			if (VTAILQ_EMPTY(&vp->dto))
+				mgt_vcl_del(vp);
 }
 
 void


More information about the varnish-commit mailing list