[master] e0b02b8 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).

Poul-Henning Kamp phk at varnish-cache.org
Fri Oct 4 08:27:17 CEST 2013


commit e0b02b84a9cacd042203cac14fa903afa7ec0b9b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Oct 4 06:26:41 2013 +0000

    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).

diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index e59e26a..dd805fd 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -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);
 }
 
diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index 9afb9a3..a605ad1 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -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);
diff --git a/bin/varnishtest/tests/b00030.vtc b/bin/varnishtest/tests/b00030.vtc
index 9703cc7..8b945e1 100644
--- a/bin/varnishtest/tests/b00030.vtc
+++ b/bin/varnishtest/tests/b00030.vtc
@@ -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
diff --git a/bin/varnishtest/tests/v00000.vtc b/bin/varnishtest/tests/v00000.vtc
index 4041d61..b2676b6 100644
--- a/bin/varnishtest/tests/v00000.vtc
+++ b/bin/varnishtest/tests/v00000.vtc
@@ -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
diff --git a/bin/varnishtest/tests/v00020.vtc b/bin/varnishtest/tests/v00020.vtc
index 2a98d30..e63be3f 100644
--- a/bin/varnishtest/tests/v00020.vtc
+++ b/bin/varnishtest/tests/v00020.vtc
@@ -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) {
 		}
 	}
 }
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index 3f20b08..6b5b365 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -172,16 +172,6 @@ sp_variables = [
 		( 'client',),
 		( 'client',),
 	),
-	('req.grace',
-		'DURATION',
-		( 'client',),
-		( 'client',),
-	),
-	('req.keep',
-		'DURATION',
-		( 'client',),
-		( 'client',),
-	),
 	('req.xid',
 		'STRING',
 		( 'client',),



More information about the varnish-commit mailing list