[master] e3cfeb558 Learn something new every day

Nils Goroll nils.goroll at uplex.de
Wed Dec 1 11:44:04 UTC 2021

commit e3cfeb5586b263605a5118d70b42c9e9dcce2d2d
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Dec 1 12:38:41 2021 +0100

    Learn something new every day
    today: VRBT_REMOVE returns the element argument no matter if it was
    present in the tree or not, so it can not sensibly be used for assertions.

diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index 5474d8ca9..75d5be180 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -562,7 +562,8 @@ vtx_retire(struct VSLQ *vslq, struct vtx **pvtx)
 	vtx->n_childready = 0;
-	AN(VRBT_REMOVE(vtx_tree, &vslq->tree, &vtx->key));
+	// remove rval is no way to check if element was present
+	(void)VRBT_REMOVE(vtx_tree, &vslq->tree, &vtx->key);
 	vtx->key.vxid = 0;
 	vtx->flags = 0;

More information about the varnish-commit mailing list