[master] 4a370dc4f simplify cnt_lookup
hermunn
hermunn at varnish-software.com
Mon Jul 2 12:39:08 UTC 2018
commit 4a370dc4f91706b19c2e3d3103c4f13957349bbc
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Tue Jun 19 15:43:25 2018 +0200
simplify cnt_lookup
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index c65434308..686f25452 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -507,23 +507,16 @@ cnt_lookup(struct worker *wrk, struct req *req)
AZ(req->objcore);
if (lr == HSH_MISS) {
- /* Found nothing or an object that was out of grace */
- if (oc == NULL) {
- /* Nothing */
- if (busy != NULL) {
- AN(busy->flags & OC_F_BUSY);
- req->objcore = busy;
- req->req_step = R_STP_MISS;
- } else {
- req->req_step = R_STP_PASS;
- }
- } else {
- /* Object out of grace */
- AN(busy); /* Else we should be on waiting list */
+ if (busy != NULL) {
+ /* hitmiss, out-of-grace or ordinary miss */
AN(busy->flags & OC_F_BUSY);
req->objcore = busy;
req->stale_oc = oc;
req->req_step = R_STP_MISS;
+ } else {
+ /* hitpass */
+ AZ(oc);
+ req->req_step = R_STP_PASS;
}
return (REQ_FSM_MORE);
}
More information about the varnish-commit
mailing list