From: phk Date: Sun, 18 Jan 2009 16:57:29 +0000 (+0000) Subject: List referenced, but gone purges, mark them with a "G" X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4955a979aedf7cea7a4861f4cb8d3ee01f8a7a6;p=varnish List referenced, but gone purges, mark them with a "G" git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3522 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_ban.c b/varnish-cache/bin/varnishd/cache_ban.c index d16dde30..0ce7cb7e 100644 --- a/varnish-cache/bin/varnishd/cache_ban.c +++ b/varnish-cache/bin/varnishd/cache_ban.c @@ -415,7 +415,6 @@ BAN_Insert(struct ban *b) } Lck_Lock(&ban_mtx); be->refcount--; - /* XXX: We should check if the tail can be removed */ VSL_stats->n_purge_dups += pcount; Lck_Unlock(&ban_mtx); } @@ -634,10 +633,12 @@ ccf_purge_list(struct cli *cli, const char * const *av, void *priv) } while (b != NULL); VTAILQ_FOREACH(b, &ban_head, list) { - if (b->flags & BAN_F_GONE) + if (b->refcount == 0 && (b->flags & BAN_F_GONE)) continue; bt = VTAILQ_FIRST(&b->tests); - cli_out(cli, "%5u\t%s", b->refcount, bt->test); + cli_out(cli, "%5u%s\t%s", b->refcount, + b->flags & BAN_F_GONE ? "G" : " ", + bt->test); do { bt = VTAILQ_NEXT(bt, list); if (bt != NULL)