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

Kill req.grace (grace is now a VCL decision, so it's unneeded).

Kill req.keep (it never made any sense in the first place).
parent 1aa28e5f
......@@ -115,8 +115,6 @@ EXP_Keep(const struct req *req, const struct object *o)
r = (double)cache_param->default_keep;
if (o->exp.keep > 0.)
r = o->exp.keep;
if (req != NULL && req->exp.keep > 0. && req->exp.keep < r)
r = req->exp.keep;
return (EXP_Ttl(req, o) + r);
}
......@@ -128,8 +126,6 @@ EXP_Grace(const struct req *req, const struct object *o)
r = (double)cache_param->default_grace;
if (o->exp.grace >= 0.)
r = o->exp.grace;
if (req != NULL && req->exp.grace > 0. && req->exp.grace < r)
r = req->exp.grace;
return (EXP_Ttl(req, o) + r);
}
......
......@@ -473,8 +473,6 @@ vrt_wsp_exp(struct vsl_log *vsl, double now, const struct exp *e)
}
VRT_DO_EXP(req, ctx->req->exp, ttl, 0, )
VRT_DO_EXP(req, ctx->req->exp, grace, 0, )
VRT_DO_EXP(req, ctx->req->exp, keep, 0, )
VRT_DO_EXP(obj, ctx->req->obj->exp, grace, 0,
EXP_Rearm(ctx->req->obj);
......
......@@ -10,7 +10,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_recv {
return (error(200,req.grace));
return (error(200,req.ttl));
}
sub vcl_error {
set obj.http.x-timestamp = now;
......@@ -20,5 +20,5 @@ varnish v1 -vcl+backend {
client c1 {
txreq
rxresp
expect resp.msg == "0.000"
expect resp.msg == "-1.000"
} -run
......@@ -10,7 +10,7 @@ server s1 -start
varnish v1 -vcl+backend {
sub vcl_recv {
set req.grace += 1 s;
set req.ttl += 1 s;
}
sub vcl_backend_response {
set beresp.ttl += 1 m;
......@@ -22,10 +22,5 @@ client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
}
client c1 -run
server s1 -wait
} -run
varnish v1 -stop
......@@ -52,7 +52,7 @@ varnish v1 -errvcl {Symbol not found: 'vcl_recv' (expected type STRING_LIST)} {
# XXX: not obvious if this actually fails for the desired reason ?
varnish v1 -errvcl {Unknown token '-' when looking for DURATION} {
sub vcl_recv {
if (req.grace < -3s || req.grace) {
if (req.ttl < -3s || req.ttl) {
set req.http.foo = vcl_recv;
}
}
......@@ -60,7 +60,7 @@ varnish v1 -errvcl {Unknown token '-' when looking for DURATION} {
varnish v1 -errvcl {'&&' must be followed by BOOL, found DURATION.} {
sub vcl_recv {
if (req.grace < 3s && req.grace) {
if (req.ttl < 3s && req.ttl) {
set req.http.foo = vcl_recv;
}
}
......@@ -74,13 +74,13 @@ varnish v1 -errvcl {Operator * not possible on type STRING.} {
varnish v1 -errvcl {DURATION + INT not possible.} {
sub vcl_backend_response {
set req.http.foo = req.grace + beresp.status;
set req.http.foo = req.ttl + beresp.status;
}
}
varnish v1 -errvcl {'!' must be followed by BOOL, found DURATION.} {
sub vcl_backend_response {
if (! req.grace) {
if (! req.ttl) {
}
}
}
......
......@@ -172,16 +172,6 @@ sp_variables = [
( 'client',),
( 'client',),
),
('req.grace',
'DURATION',
( 'client',),
( 'client',),
),
('req.keep',
'DURATION',
( 'client',),
( 'client',),
),
('req.xid',
'STRING',
( 'client',),
......
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