bin/varnishd/cache_vrt.c
void
VRT_l_obj_ttl(const struct sess *sp, double a)
{

	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
	CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);	/* XXX */
	if (sp->obj->objcore == NULL)
		return;
	WSP(sp, SLT_TTL, "%u VCL %.0f %.0f",
	    sp->obj->xid, a, sp->t_req);
	/*
	 * If people set obj.ttl = 0s, they don't expect it to be cacheable
	 * any longer, but it will still be for up to 1s - epsilon because
	 * of the rounding to seconds.
	 * We special case and make sure that rounding does not surprise.
	 */
	if (a <= 0)
		sp->obj->ttl = sp->t_req - 1;
	else
		sp->obj->ttl = sp->t_req + a;
	EXP_Rearm(sp->obj);
}
/*--------------------------------------------------------------------
 * XXX: Working relative to t_req is maybe not the right thing, we could
 * XXX: have spent a long time talking to the backend since then.
 * XXX: It might make sense to cache a timestamp as "current time"
 * XXX: before vcl_recv (== t_req) and vcl_fetch.
 * XXX: On the other hand, that might lead to inconsistent behaviour
 * XXX: where an object expires while we are running VCL code, and
 * XXX: and that may not be a good idea either.
 * XXX: See also related t_req use in cache_hash.c
 */
Working relative to t_req is maybe not the right thing, we could
XXX: have spent a long time talking to the backend since then.
XXX: It might make sense to cache a timestamp as "current time"
XXX: before vcl_recv (== t_req) and vcl_fetch.
XXX: On the other hand, that might lead to inconsistent behaviour
XXX: where an object expires while we are running VCL code, and
XXX: and that may not be a good idea either.
XXX: See also related t_req use in cache_hash.c
Working relative to t_req is maybe not the right thing we could XXX : have spent a long time talking to the backend since then . XXX : It might make sense to cache a timestamp as " current time " XXX : before vcl_recv ( == t_req ) and vcl_fetch . XXX : On the other hand that might lead to inconsistent behaviour XXX : where an object expires while we are running VCL code and XXX : and that may not be a good idea either . XXX : See also related t_req use in cache_hash . c
void
VRT_l_obj_ttl(const struct sess *sp, double a)
{
	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
	CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);	
	if (sp->obj->objcore == NULL)
		return;
	WSP(sp, SLT_TTL, "%u VCL %.0f %.0f",
	    sp->obj->xid, a, sp->t_req);
	if (a <= 0)
		sp->obj->ttl = sp->t_req - 1;
	else
		sp->obj->ttl = sp->t_req + a;
	EXP_Rearm(sp->obj);
}
void VRT_l_obj_ttl ( const struct sess * sp , double a ) { CHECK_OBJ_NOTNULL ( sp , SESS_MAGIC ) ; CHECK_OBJ_NOTNULL ( sp -> obj , OBJECT_MAGIC ) ; if ( sp -> obj -> objcore == NULL ) return ; WSP ( sp , SLT_TTL , " " , sp -> obj -> xid , a , sp -> t_req ) ; if ( a <= 0 ) sp -> obj -> ttl = sp -> t_req - 1 ; else sp -> obj -> ttl = sp -> t_req + a ; EXP_Rearm ( sp -> obj ) ; }
XXX: Working relative to t_req is maybe not the right thing, we could
 XXX: have spent a long time talking to the backend since then.
XXX : Working relative to t_req is maybe not the right thing we could XXX : have spent a long time talking to the backend since then .
/* XXX */ /*
	 * If people set obj.ttl = 0s, they don't expect it to be cacheable
	 * any longer, but it will still be for up to 1s - epsilon because
	 * of the rounding to seconds.
	 * We special case and make sure that rounding does not surprise.
	 */