[PATCH 4/5] Mark the ban_magic as gone also in the persisted ban spec, so it can be recognized as such on reload

Martin Blix Grydeland martin at varnish-software.com
Fri Dec 14 18:41:02 CET 2012


---
 bin/varnishd/cache/cache_ban.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index afff464..a06fd98 100644
--- a/bin/varnishd/cache/cache_ban.c
+++ b/bin/varnishd/cache/cache_ban.c
@@ -265,6 +265,8 @@ ban_mark_gone(struct ban *b)
 	unsigned ln;
 
 	CHECK_OBJ_NOTNULL(b, BAN_MAGIC);
+	AN(b->spec);
+	AZ(b->flags & BAN_F_GONE);
 	ln = ban_len(b->spec);
 	b->flags |= BAN_F_GONE;
 	b->spec[BANS_FLAGS] |= BANS_FLAG_GONE;
@@ -1268,9 +1270,8 @@ BAN_Init(void)
 
 	ban_magic = BAN_New();
 	AN(ban_magic);
-	ban_magic->flags |= BAN_F_GONE;
-	VSC_C_main->bans_gone++;
 	BAN_Insert(ban_magic);
+	ban_mark_gone(ban_magic);
 }
 
 /*--------------------------------------------------------------------
-- 
1.7.10.4




More information about the varnish-dev mailing list