[master] f83a75d Polish

Federico G. Schwindt fgsch at lodoss.net
Mon May 30 20:03:05 CEST 2016


commit f83a75dd859e5dc18fed5fa8ecc29d69aa5d3cc6
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Mon May 30 18:38:37 2016 +0100

    Polish

diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index b808670..c552416 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -445,7 +445,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
 					oc->hits++;
 			}
 			Lck_Unlock(&oh->mtx);
-			if (oc == NULL) 
+			if (oc == NULL)
 				return (HSH_MISS);
 			assert(HSH_DerefObjHead(wrk, &oh));
 			*ocp = oc;
diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index efb2949..b6c5879 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -290,8 +290,7 @@ VRT_hashdata(VRT_CTX, const char *str, ...)
 double
 VRT_r_now(VRT_CTX)
 {
-
-	(void)ctx;
+	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	return (ctx->now);
 }
 
@@ -500,10 +499,7 @@ VRT_purge(VRT_CTX, double ttl, double grace, double keep)
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
 	CHECK_OBJ_NOTNULL(ctx->req->wrk, WORKER_MAGIC);
-	if (ctx->method == VCL_MET_HIT)
-		HSH_Purge(ctx->req->wrk, ctx->req->objcore->objhead,
-		    ttl, grace, keep);
-	else if (ctx->method == VCL_MET_MISS)
+	if (ctx->method == VCL_MET_HIT || ctx->method == VCL_MET_MISS)
 		HSH_Purge(ctx->req->wrk, ctx->req->objcore->objhead,
 		    ttl, grace, keep);
 }



More information about the varnish-commit mailing list