[master] 3ebb00033 varnishd: Apply obj_wait_state_check.cocci

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Oct 27 14:09:06 UTC 2025


commit 3ebb00033d94f65a6ba4705c3de2eab4bbd0176a
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Oct 3 10:23:55 2025 +0200

    varnishd: Apply obj_wait_state_check.cocci

diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index ccb44d32d..06daeb958 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -911,7 +911,7 @@ ved_deliver(struct req *req, int wantbody)
 
 		/* OA_GZIPBITS are not valid until BOS_FINISHED */
 		if (req->boc != NULL)
-			ObjWaitState(req->objcore, BOS_FINISHED);
+			(void)ObjWaitState(req->objcore, BOS_FINISHED);
 
 		if (req->objcore->flags & OC_F_FAILED) {
 			/* No way of signalling errors in the middle of
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index da85a129f..d59f9e47c 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -894,7 +894,7 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
 		VSLb(bo->vsl, SLT_Notice,
 		    "vsl: Conditional fetch wait for streaming object");
 		/* XXX: We should have a VCL controlled timeout here */
-		ObjWaitState(stale_oc, BOS_FINISHED);
+		(void)ObjWaitState(stale_oc, BOS_FINISHED);
 		stale_state = stale_boc->state;
 		HSH_DerefBoc(bo->wrk, stale_oc);
 		stale_boc = NULL;
@@ -1180,6 +1180,7 @@ void
 VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
     struct objcore *oldoc, enum vbf_fetch_mode_e mode)
 {
+	enum boc_state_e state;
 	struct boc *boc;
 	struct busyobj *bo;
 	enum task_prio prio;
@@ -1265,12 +1266,12 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
 		THR_SetBusyobj(NULL);
 		bo = NULL; /* ref transferred to fetch thread */
 		if (mode == VBF_BACKGROUND) {
-			ObjWaitState(oc, BOS_REQ_DONE);
+			(void)ObjWaitState(oc, BOS_REQ_DONE);
 			(void)VRB_Ignore(req);
 		} else {
-			ObjWaitState(oc, BOS_STREAM);
+			state = ObjWaitState(oc, BOS_STREAM);
 			AZ(oc->flags & OC_F_BUSY);
-			if (oc->boc->state == BOS_FAILED)
+			if (state == BOS_FAILED)
 				AN(oc->flags & OC_F_FAILED);
 		}
 	}
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 06afcd78a..23303a60e 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -990,7 +990,7 @@ HSH_Cancel(struct worker *wrk, struct objcore *oc, struct boc *boc)
 
 	if (boc != NULL) {
 		hsh_cancel(oc);
-		ObjWaitState(oc, BOS_FINISHED);
+		(void)ObjWaitState(oc, BOS_FINISHED);
 	}
 
 	if (bocref != NULL)
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 9dc0db092..f4d3810a2 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -448,7 +448,7 @@ cnt_transmit(struct worker *wrk, struct req *req)
 	/* Grab a ref to the bo if there is one (=streaming) */
 	req->boc = HSH_RefBoc(req->objcore);
 	if (req->boc && req->boc->state < BOS_STREAM)
-		ObjWaitState(req->objcore, BOS_STREAM);
+		(void)ObjWaitState(req->objcore, BOS_STREAM);
 	clval = http_GetContentLength(req->resp);
 	/* RFC 7230, 3.3.3 */
 	status = http_GetStatus(req->resp);


More information about the varnish-commit mailing list