Commit e7af27ec authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make the -d option to varnishlog et all exit when the log is emptied.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4191 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent a07f6efa
......@@ -264,31 +264,36 @@ exp_timer(struct sess *sp, void *priv)
continue;
}
o = oc->obj;
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
CHECK_OBJ_NOTNULL(o->objhead, OBJHEAD_MAGIC);
assert(oc->flags & OC_F_ONLRU);
/* It's time... */
/* Remove from binheap */
assert(oc->timer_idx != BINHEAP_NOIDX);
binheap_delete(exp_heap, oc->timer_idx);
assert(oc->timer_idx == BINHEAP_NOIDX);
lru = STV_lru(o->objstore);
AN(lru);
VTAILQ_REMOVE(lru, o->objcore, lru_list);
oc->flags &= ~OC_F_ONLRU;
{ /* Sanity checking */
struct objcore *oc2 = binheap_root(exp_heap);
if (oc2 != NULL) {
assert(oc2->timer_idx != BINHEAP_NOIDX);
assert(oc2->timer_when >= oc->timer_when);
}
/* And from LRU */
if (oc->flags & OC_F_ONLRU) {
assert(!(oc->flags & OC_F_PERSISTENT));
lru = STV_lru(o->objstore);
AN(lru);
VTAILQ_REMOVE(lru, o->objcore, lru_list);
oc->flags &= ~OC_F_ONLRU;
} else {
assert(oc->flags & OC_F_PERSISTENT);
}
VSL_stats->n_expired++;
Lck_Unlock(&exp_mtx);
if (!(oc->flags & OC_F_PERSISTENT)) {
o = oc->obj;
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
HSH_Deref(sp->wrk, &o);
CHECK_OBJ_NOTNULL(o->objhead, OBJHEAD_MAGIC);
}
WSL(sp->wrk, SLT_ExpKill, 0, "%u %d",
o->xid, (int)(o->ttl - t));
HSH_Deref(sp->wrk, &o);
}
}
......
......@@ -540,7 +540,10 @@ VSL_Arg(struct VSL_data *vd, int arg, const char *opt)
switch (arg) {
case 'b': vd->b_opt = !vd->b_opt; return (1);
case 'c': vd->c_opt = !vd->c_opt; return (1);
case 'd': vd->d_opt = !vd->d_opt; return (1);
case 'd':
vd->d_opt = !vd->d_opt;
vd->flags |= F_NON_BLOCKING;
return (1);
case 'i': case 'x': return (vsl_ix_arg(vd, opt, arg));
case 'r': return (vsl_r_arg(vd, opt));
case 'I': case 'X': return (vsl_IX_arg(vd, opt, arg));
......
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