[4.0] 8815683 Minor polish

Poul-Henning Kamp phk at FreeBSD.org
Thu Mar 13 10:24:21 CET 2014


commit 8815683613a7a1b3159bcf608a8336dda667d734
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 27 10:40:01 2014 +0000

    Minor polish

diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index 426faa7..477aa6a 100644
--- a/bin/varnishd/cache/cache_ban.c
+++ b/bin/varnishd/cache/cache_ban.c
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2006 Verdens Gang AS
- * Copyright (c) 2006-2011 Varnish Software AS
+ * Copyright (c) 2006-2014 Varnish Software AS
  * All rights reserved.
  *
  * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
@@ -1170,27 +1170,20 @@ ban_lurker(struct worker *wrk, void *priv)
 {
 	struct vsl_log vsl;
 	volatile double d;
-	int i;
+
+	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
+	AZ(priv);
 
 	VSL_Setup(&vsl, NULL, 0);
 
-	(void)priv;
 	while (!ban_shutdown) {
-		i = 0;
 		d = cache_param->ban_lurker_sleep;
-		if (d > 0.0)
-			i = ban_lurker_work(wrk, &vsl);
+		if (d <= 0.0 || !ban_lurker_work(wrk, &vsl))
+			d = 0.609;	// Random, non-magic
 		ban_cleantail();
-		if (ban_shutdown)
-			break;
-		if (i)
-			VTIM_sleep(d);
-		else
-			VTIM_sleep(0.609);	// Random, non-magic
+		VTIM_sleep(d);
 	}
-
 	pthread_exit(0);
-
 	NEEDLESS_RETURN(NULL);
 }
 



More information about the varnish-commit mailing list