[6.0] cb370c88d simplify cnt_lookup

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Aug 16 08:53:17 UTC 2018


commit cb370c88d284ac4cb7ee8375e0f36a50a8472199
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 83ddc4760..17c9899c7 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -508,23 +508,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