[master] 561adad Also use STV_Foreach() in the worker process

Poul-Henning Kamp phk at FreeBSD.org
Tue Nov 1 20:45:05 CET 2016


commit 561adad261715c7326e62036173dcef729dd7e5e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Nov 1 12:27:07 2016 +0000

    Also use STV_Foreach() in the worker process

diff --git a/bin/varnishd/storage/stevedore.c b/bin/varnishd/storage/stevedore.c
index 300faca..c32105a 100644
--- a/bin/varnishd/storage/stevedore.c
+++ b/bin/varnishd/storage/stevedore.c
@@ -136,7 +136,7 @@ STV_BanInfoDrop(const uint8_t *ban, unsigned len)
 	struct stevedore *stv;
 	int r = 0;
 
-	VTAILQ_FOREACH(stv, &stv_stevedores, list)
+	STV_Foreach(stv)
 		if (stv->baninfo != NULL)
 			r |= stv->baninfo(stv, BI_DROP, ban, len);
 
@@ -149,7 +149,7 @@ STV_BanInfoNew(const uint8_t *ban, unsigned len)
 	struct stevedore *stv;
 	int r = 0;
 
-	VTAILQ_FOREACH(stv, &stv_stevedores, list)
+	STV_Foreach(stv)
 		if (stv->baninfo != NULL)
 			r |= stv->baninfo(stv, BI_NEW, ban, len);
 
@@ -167,7 +167,7 @@ STV_BanExport(const uint8_t *bans, unsigned len)
 {
 	struct stevedore *stv;
 
-	VTAILQ_FOREACH(stv, &stv_stevedores, list)
+	STV_Foreach(stv)
 		if (stv->banexport != NULL)
 			stv->banexport(stv, bans, len);
 }
@@ -179,13 +179,11 @@ STV_BanExport(const uint8_t *bans, unsigned len)
 const struct stevedore *
 STV_find(const char *nm)
 {
-	const struct stevedore *stv;
+	struct stevedore *stv;
 
-	VTAILQ_FOREACH(stv, &stv_stevedores, list)
+	STV_Foreach(stv)
 		if (!strcmp(stv->ident, nm))
 			return (stv);
-	if (!strcmp(TRANSIENT_STORAGE, nm))
-		return (stv_transient);
 	return (NULL);
 }
 



More information about the varnish-commit mailing list