#define OBJCORE_MAGIC 0x4d301302
struct object *obj;
double timer_when;
- double ttl;
unsigned char flags;
#define OC_F_ONLRU (1<<0)
#define OC_F_BUSY (1<<1)
unsigned len;
+ double ttl;
double age;
double entered;
double grace;
o->ban = b0;
return (0);
} else {
- o->objcore->ttl = 0;
+ o->ttl = 0;
WSP(sp, SLT_ExpBan, "%u was banned", o->xid);
EXP_Rearm(o);
o->ban = NULL;
cnt_fetch(struct sess *sp)
{
int i;
- struct objcore *oc;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
sp->step = STP_RECV;
return (0);
case VCL_RET_PASS:
- if (sp->obj->objcore != NULL) {
- oc = sp->obj->objcore;
- oc->flags |= OC_F_PASS;
- if (oc->ttl - sp->t_req < params->default_ttl)
- oc->ttl = sp->t_req + params->default_ttl;
- }
+ if (sp->obj->objcore != NULL)
+ sp->obj->objcore->flags |= OC_F_PASS;
+ if (sp->obj->ttl - sp->t_req < params->default_ttl)
+ sp->obj->ttl = sp->t_req + params->default_ttl;
break;
case VCL_RET_DELIVER:
break;
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
Lck_AssertHeld(&exp_mtx);
- when = oc->ttl + HSH_Grace(o->grace);
+ when = o->ttl + HSH_Grace(o->grace);
assert(!isnan(when));
if (when == oc->timer_when)
return (0);
assert(sp->handling == VCL_RET_DISCARD);
WSL(&ww, SLT_ExpKill, 0,
- "%u %d", o->xid, (int)(o->objcore->ttl - t));
+ "%u %d", o->xid, (int)(o->ttl - t));
Lck_Lock(&exp_mtx);
assert(oc->timer_idx == BINHEAP_NOIDX);
VTAILQ_REMOVE(&lru, o->objcore, lru_list);
}
if (!o->cacheable)
continue;
- if (oc->ttl == 0)
+ if (o->ttl == 0)
continue;
if (BAN_CheckObject(o, sp))
continue;
continue;
/* If still valid, use it */
- if (oc->ttl >= sp->t_req)
+ if (o->ttl >= sp->t_req)
break;
/* Remember any matching objects inside their grace period */
- if (oc->ttl + HSH_Grace(o->grace) >= sp->t_req)
+ if (o->ttl + HSH_Grace(o->grace) >= sp->t_req)
grace_o = o;
}
if (oc == NULL)
*/
if (o == NULL && grace_o != NULL &&
grace_o->child != NULL &&
- grace_o->objcore->ttl + HSH_Grace(sp->grace) >= sp->t_req)
+ grace_o->ttl + HSH_Grace(sp->grace) >= sp->t_req)
o = grace_o;
if (o != NULL) {
assert(o->refcnt > 0);
if (o->objcore != NULL) { /* Pass has no objcore */
AN(ObjIsBusy(o));
- o->objcore->ttl = 0;
+ o->ttl = 0;
}
o->cacheable = 0;
if (o->objcore != NULL) /* Pass has no objcore */
* We special case and make sure that rounding does not surprise.
*/
if (a <= 0)
- sp->obj->objcore->ttl = sp->t_req - 1;
+ sp->obj->ttl = sp->t_req - 1;
else
- sp->obj->objcore->ttl = sp->t_req + a;
+ sp->obj->ttl = sp->t_req + a;
EXP_Rearm(sp->obj);
}
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */
if (sp->obj->objcore == NULL)
return (0.0);
- return (sp->obj->objcore->ttl - sp->t_req);
+ return (sp->obj->ttl - sp->t_req);
}
/*--------------------------------------------------------------------
}
ttl = RFC2616_Ttl(sp, hp, sp->obj);
- if (sp->obj->objcore != NULL)
- sp->obj->objcore->ttl = ttl;
+ sp->obj->ttl = ttl;
if (ttl == 0)
sp->obj->cacheable = 0;