r4389 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Dec 14 12:03:23 CET 2009


Author: phk
Date: 2009-12-14 12:03:23 +0100 (Mon, 14 Dec 2009)
New Revision: 4389

Modified:
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_backend.h
   trunk/varnish-cache/bin/varnishd/cache_dir_random.c
   trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c
   trunk/varnish-cache/bin/varnishd/cache_dir_simple.c
Log:
Rename backend_is_healthy() to VBE_Healthy() for naming-space consistency.



Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2009-12-14 10:05:28 UTC (rev 4388)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2009-12-14 11:03:23 UTC (rev 4389)
@@ -229,7 +229,7 @@
 	sp->vbe = sp->director->getfd(sp);
 }
 
-/*
+/*--------------------------------------------------------------------
  * It evaluates if a backend is healthy _for_a_specific_object_.
  * That means that it relies on sp->objhead. This is mainly for saint-mode,
  * but also takes backend->healthy into account. If
@@ -239,8 +239,9 @@
  * The threshold has to be evaluated _after_ the timeout check, otherwise
  * items would never time out once the threshold is reached.
  */
+
 unsigned int
-backend_is_healthy(const struct sess *sp, struct backend *backend)
+VBE_Healthy(const struct sess *sp, struct backend *backend)
 {
 	struct trouble *tr;
 	struct trouble *tr2;
@@ -339,7 +340,7 @@
 		VBE_ClosedFd(sp);
 	}
 
-	if (!backend_is_healthy(sp, bp)) {
+	if (!VBE_Healthy(sp, bp)) {
 		VSL_stats->backend_unhealthy++;
 		return (NULL);
 	}

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.h	2009-12-14 10:05:28 UTC (rev 4388)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.h	2009-12-14 11:03:23 UTC (rev 4389)
@@ -143,7 +143,7 @@
 /* cache_backend.c */
 void VBE_ReleaseConn(struct vbe_conn *vc);
 struct vbe_conn *VBE_GetVbe(struct sess *sp, struct backend *bp);
-unsigned int backend_is_healthy(const struct sess *sp, struct backend *backend);
+unsigned int VBE_Healthy(const struct sess *sp, struct backend *backend);
 
 /* cache_backend_cfg.c */
 extern struct lock VBE_mtx;

Modified: trunk/varnish-cache/bin/varnishd/cache_dir_random.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_random.c	2009-12-14 10:05:28 UTC (rev 4388)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_random.c	2009-12-14 11:03:23 UTC (rev 4389)
@@ -81,7 +81,7 @@
 		/* Sum up the weights of healty backends */
 		s1 = 0.0;
 		for (i = 0; i < vs->nhosts; i++)
-			if (backend_is_healthy(sp,vs->hosts[i].backend))
+			if (VBE_Healthy(sp,vs->hosts[i].backend))
 				s1 += vs->hosts[i].weight;
 
 		if (s1 == 0.0)
@@ -94,7 +94,7 @@
 
 		s1 = 0.0;
 		for (i = 0; i < vs->nhosts; i++)  {
-			if (!backend_is_healthy(sp, vs->hosts[i].backend))
+			if (!VBE_Healthy(sp, vs->hosts[i].backend))
 				continue;
 			s1 += vs->hosts[i].weight;
 			if (r >= s1)
@@ -120,7 +120,7 @@
 	CAST_OBJ_NOTNULL(vs, sp->director->priv, VDI_RANDOM_MAGIC);
 
 	for (i = 0; i < vs->nhosts; i++) {
-		if (backend_is_healthy(sp,vs->hosts[i].backend))
+		if (VBE_Healthy(sp,vs->hosts[i].backend))
 			return 1;
 	}
 	return 0;

Modified: trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c	2009-12-14 10:05:28 UTC (rev 4388)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c	2009-12-14 11:03:23 UTC (rev 4389)
@@ -75,7 +75,7 @@
 	for (i = 0; i < vs->nhosts; i++) {
 		backend = vs->hosts[vs->next_host].backend;
 		vs->next_host = (vs->next_host + 1) % vs->nhosts;
-		if (!backend_is_healthy(sp, backend))
+		if (!VBE_Healthy(sp, backend))
 			continue;
 		vbe = VBE_GetVbe(sp, backend);
 		if (vbe != NULL)
@@ -96,7 +96,7 @@
 	CAST_OBJ_NOTNULL(vs, sp->director->priv, VDI_ROUND_ROBIN_MAGIC);
 
 	for (i = 0; i < vs->nhosts; i++) {
-		if (backend_is_healthy(sp, vs->hosts[i].backend))
+		if (VBE_Healthy(sp, vs->hosts[i].backend))
 			return 1;
 	}
 	return 0;

Modified: trunk/varnish-cache/bin/varnishd/cache_dir_simple.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_simple.c	2009-12-14 10:05:28 UTC (rev 4388)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_simple.c	2009-12-14 11:03:23 UTC (rev 4389)
@@ -75,7 +75,7 @@
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	CHECK_OBJ_NOTNULL(sp->director, DIRECTOR_MAGIC);
 	CAST_OBJ_NOTNULL(vs, sp->director->priv, VDI_SIMPLE_MAGIC);
-	return (backend_is_healthy(sp, vs->backend));
+	return (VBE_Healthy(sp, vs->backend));
 }
 
 /*lint -e{818} not const-able */



More information about the varnish-commit mailing list