Commit 1700d5fb authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Use a flag for "compile pending" status



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3940 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 6da05934
......@@ -513,12 +513,17 @@ BAN_Reload(double t0, unsigned flags, const char *ban)
b2->test = strdup(ban);
AN(b2->test);
b2->t0 = t0;
b2->flags |= BAN_F_PENDING;
if (b == NULL)
VTAILQ_INSERT_TAIL(&ban_head, b2, list);
else
VTAILQ_INSERT_BEFORE(b, b2, list);
}
/*--------------------------------------------------------------------
* All silos have read their bans now compile them.
*/
void
BAN_Compile(void)
{
......@@ -529,10 +534,9 @@ BAN_Compile(void)
ASSERT_CLI();
VTAILQ_FOREACH(b, &ban_head, list) {
if (!VTAILQ_EMPTY(&b->tests))
continue;
if (b->test == NULL || *b->test == '\0')
if (!(b->flags & BAN_F_PENDING))
continue;
b->flags &= ~BAN_F_PENDING;
av = ParseArgv(b->test, 0);
XXXAN(av);
XXXAZ(av[0]);
......
......@@ -56,6 +56,7 @@ struct ban {
unsigned refcount;
int flags;
#define BAN_F_GONE (1 << 0)
#define BAN_F_PENDING (1 << 1)
VTAILQ_HEAD(,ban_test) tests;
double t0;
struct vsb *vsb;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment