/* cache_expiry.c */
void EXP_Insert(struct object *o);
void EXP_Init(void);
-void EXP_TTLchange(struct object *o);
+void EXP_Rearm(struct object *o);
void EXP_Touch(struct object *o, double now);
int EXP_NukeOne(struct sess *sp);
}
}
+/*--------------------------------------------------------------------
+ * We have changed one or more of the object timers, shuffle it
+ * accordingly in the binheap
+ *
+ * The VCL code can send us here on a non-cached object, just return.
+ *
+ * XXX: special case check for ttl = 0 ?
+ */
+
void
-EXP_TTLchange(struct object *o)
+EXP_Rearm(struct object *o)
{
+ if (o->timer_idx == 0)
+ return;
LOCK(&exp_mtx);
if (o->timer_idx != lru_target) {
assert(o->timer_idx != 0); /* XXX: symbolic zero ? */
if (BAN_CheckObject(o, h->hd[HTTP_HDR_URL].b, oh->hash)) {
o->ttl = 0;
WSP(sp, SLT_ExpBan, "%u was banned", o->xid);
- if (o->timer_idx != 0)
- EXP_TTLchange(o);
+ EXP_Rearm(o);
continue;
}
if (o->vary != NULL && !VRY_Match(sp, o->vary))
if (a < 0)
a = 0;
sp->obj->ttl = sp->t_req + a;
- if (sp->obj->timer_idx != 0)
- EXP_TTLchange(sp->obj);
+ EXP_Rearm(sp->obj);
}
double
if (a < 0)
a = 0;
sp->obj->grace = a;
- if (sp->obj->timer_idx != 0)
- EXP_TTLchange(sp->obj);
+ EXP_Rearm(sp->obj);
}
double
WSL(sp->wrk, SLT_VCL_info, sp->id,
"XID %u: obj.prefetch (%g) less than ttl (%g), ignored.",
sp->obj->xid, a, sp->obj->ttl - sp->t_req);
- if (sp->obj->timer_idx != 0)
- EXP_TTLchange(sp->obj);
+ EXP_Rearm(sp->obj);
}
double