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

When obj.ttl or beresp.ttl is set to zero, also set the corresponding

grace to zero.

if you want ttl=0 with a non-zero grace, set ttl first, then set grace.
parent 00b606f3
...@@ -246,9 +246,10 @@ VRT_l_beresp_ttl(const struct sess *sp, double a) ...@@ -246,9 +246,10 @@ VRT_l_beresp_ttl(const struct sess *sp, double a)
* of the rounding to seconds. * of the rounding to seconds.
* We special case and make sure that rounding does not surprise. * We special case and make sure that rounding does not surprise.
*/ */
if (a <= 0) if (a <= 0) {
sp->wrk->ttl = sp->t_req - 1; sp->wrk->ttl = sp->t_req - 1;
else sp->wrk->grace = 0.;
} else
sp->wrk->ttl = sp->t_req + a; sp->wrk->ttl = sp->t_req + a;
} }
...@@ -349,9 +350,10 @@ VRT_l_obj_ttl(const struct sess *sp, double a) ...@@ -349,9 +350,10 @@ VRT_l_obj_ttl(const struct sess *sp, double a)
* of the rounding to seconds. * of the rounding to seconds.
* We special case and make sure that rounding does not surprise. * We special case and make sure that rounding does not surprise.
*/ */
if (a <= 0) if (a <= 0) {
sp->obj->ttl = sp->t_req - 1; sp->obj->ttl = sp->t_req - 1;
else sp->obj->grace = 0;
} else
sp->obj->ttl = sp->t_req + a; sp->obj->ttl = sp->t_req + a;
EXP_Rearm(sp->obj); EXP_Rearm(sp->obj);
} }
......
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