[master] 756940f cnt_recv: replace return from switch with break
Nils Goroll
nils.goroll at uplex.de
Fri Dec 29 10:38:09 UTC 2017
commit 756940fe0ab7a40d1189d8d07a156cd526f0d77e
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Tue Dec 26 16:37:53 2017 +0100
cnt_recv: replace return from switch with break
just a minor stylistic cleanup: Early returns should mark exceptional
cases.
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index f52f8f6..40d87ba 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -890,13 +890,13 @@ cnt_recv(struct worker *wrk, struct req *req)
"Only from active VCL");
req->err_code = 503;
req->req_step = R_STP_SYNTH;
- return (REQ_FSM_MORE);
+ break;
case VCL_RET_PURGE:
req->req_step = R_STP_PURGE;
- return (REQ_FSM_MORE);
+ break;
case VCL_RET_HASH:
req->req_step = R_STP_LOOKUP;
- return (REQ_FSM_MORE);
+ break;
case VCL_RET_PIPE:
if (req->esi_level > 0) {
VSLb(req->vsl, SLT_VCL_Error,
@@ -911,19 +911,20 @@ cnt_recv(struct worker *wrk, struct req *req)
} else {
req->req_step = R_STP_PIPE;
}
- return (REQ_FSM_MORE);
+ break;
case VCL_RET_PASS:
req->req_step = R_STP_PASS;
- return (REQ_FSM_MORE);
+ break;
case VCL_RET_SYNTH:
req->req_step = R_STP_SYNTH;
- return (REQ_FSM_MORE);
+ break;
case VCL_RET_FAIL:
req->req_step = R_STP_VCLFAIL;
- return (REQ_FSM_MORE);
+ break;
default:
WRONG("Illegal return from vcl_recv{}");
}
+ return (REQ_FSM_MORE);
}
/*--------------------------------------------------------------------
More information about the varnish-commit
mailing list