Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit c7e5ad5

Browse files
committed
varnishd: Apply obj_wait_state_check.cocci
1 parent 723da9a commit c7e5ad5

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

bin/varnishd/cache/cache_esi_deliver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ ved_deliver(struct req *req, int wantbody)
911911

912912
/* OA_GZIPBITS are not valid until BOS_FINISHED */
913913
if (req->boc != NULL)
914-
ObjWaitState(req->objcore, BOS_FINISHED);
914+
(void)ObjWaitState(req->objcore, BOS_FINISHED);
915915

916916
if (req->objcore->flags & OC_F_FAILED) {
917917
/* No way of signalling errors in the middle of

bin/varnishd/cache/cache_fetch.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
886886
VSLb(bo->vsl, SLT_Notice,
887887
"vsl: Conditional fetch wait for streaming object");
888888
/* XXX: We should have a VCL controlled timeout here */
889-
ObjWaitState(stale_oc, BOS_FINISHED);
889+
(void)ObjWaitState(stale_oc, BOS_FINISHED);
890890
stale_state = stale_boc->state;
891891
HSH_DerefBoc(bo->wrk, stale_oc);
892892
stale_boc = NULL;
@@ -1172,6 +1172,7 @@ void
11721172
VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
11731173
struct objcore *oldoc, enum vbf_fetch_mode_e mode)
11741174
{
1175+
enum boc_state_e state;
11751176
struct boc *boc;
11761177
struct busyobj *bo;
11771178
enum task_prio prio;
@@ -1257,12 +1258,12 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
12571258
THR_SetBusyobj(NULL);
12581259
bo = NULL; /* ref transferred to fetch thread */
12591260
if (mode == VBF_BACKGROUND) {
1260-
ObjWaitState(oc, BOS_REQ_DONE);
1261+
(void)ObjWaitState(oc, BOS_REQ_DONE);
12611262
(void)VRB_Ignore(req);
12621263
} else {
1263-
ObjWaitState(oc, BOS_STREAM);
1264+
state = ObjWaitState(oc, BOS_STREAM);
12641265
AZ(oc->flags & OC_F_BUSY);
1265-
if (oc->boc->state == BOS_FAILED)
1266+
if (state == BOS_FAILED)
12661267
AN(oc->flags & OC_F_FAILED);
12671268
}
12681269
}

bin/varnishd/cache/cache_hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ HSH_Cancel(struct worker *wrk, struct objcore *oc, struct boc *boc)
990990

991991
if (boc != NULL) {
992992
hsh_cancel(oc);
993-
ObjWaitState(oc, BOS_FINISHED);
993+
(void)ObjWaitState(oc, BOS_FINISHED);
994994
}
995995

996996
if (bocref != NULL)

bin/varnishd/cache/cache_req_fsm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ cnt_transmit(struct worker *wrk, struct req *req)
448448
/* Grab a ref to the bo if there is one (=streaming) */
449449
req->boc = HSH_RefBoc(req->objcore);
450450
if (req->boc && req->boc->state < BOS_STREAM)
451-
ObjWaitState(req->objcore, BOS_STREAM);
451+
(void)ObjWaitState(req->objcore, BOS_STREAM);
452452
clval = http_GetContentLength(req->resp);
453453
/* RFC 7230, 3.3.3 */
454454
status = http_GetStatus(req->resp);

0 commit comments

Comments
 (0)