[master] b559b6b2d Flexelint e74abf895d2e1147ab474e0490cbf7dd33ce2454

Nils Goroll nils.goroll at uplex.de
Wed Feb 17 19:39:06 UTC 2021


commit b559b6b2daabc67901dfae07571b1300869ef690
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Feb 17 20:36:26 2021 +0100

    Flexelint e74abf895d2e1147ab474e0490cbf7dd33ce2454

diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 25beaf3d8..cc1e44c26 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -397,7 +397,6 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp)
 	busy_found = 0;
 	exp_oc = NULL;
 	exp_t_origin = 0.0;
-	wrk->strangelove = 0;
 	VTAILQ_FOREACH(oc, &oh->objcs, hsh_list) {
 		/* Must be at least our own ref + the objcore we examine */
 		assert(oh->refcnt > 1);
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index eb40fa98f..ea09689f6 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -542,8 +542,10 @@ cnt_lookup(struct worker *wrk, struct req *req)
 	AZ(req->objcore);
 	if (req->hash_objhead)
 		had_objhead = 1;
+	wrk->strangelove = 0;
 	lr = HSH_Lookup(req, &oc, &busy);
-	if (wrk->strangelove >= cache_param->vary_notice)
+	assert(wrk->strangelove >= 0);
+	if ((unsigned)wrk->strangelove >= cache_param->vary_notice)
 		VSLb(req->vsl, SLT_Notice, "vsl: High number of variants (%d)",
 		    wrk->strangelove);
 	if (lr == HSH_BUSY) {


More information about the varnish-commit mailing list