[master] d1c6ef5 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-cache.org
Fri Feb 15 14:58:00 CET 2013


commit d1c6ef5e91aff24a72d64542d77050ab0d1a2acf
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Fri Dec 14 17:33:04 2012 +0100

    Mark the ban_magic as gone also in the persisted ban spec, so it can
    be recognized as such on reload

diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index ed4c041..eb9e179 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;
@@ -1267,9 +1269,8 @@ BAN_Init(void)
 
 	ban_magic = BAN_New();
 	AN(ban_magic);
-	ban_magic->flags |= BAN_F_GONE;
-	VSC_C_main->bans_gone++;
 	AZ(BAN_Insert(ban_magic));
+	ban_mark_gone(ban_magic);
 }
 
 /*--------------------------------------------------------------------



More information about the varnish-commit mailing list