[master] 282559d Don't use req.restarts in vcl_backend_response{}, it's a bad example and does nothing to make the tests objective any clearer.
Poul-Henning Kamp
phk at varnish-cache.org
Mon May 6 10:18:54 CEST 2013
commit 282559d9f8b34055cdc8c8db47f4c8542e10405c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon May 6 08:18:16 2013 +0000
Don't use req.restarts in vcl_backend_response{}, it's a bad example
and does nothing to make the tests objective any clearer.
diff --git a/bin/varnishtest/tests/r01091.vtc b/bin/varnishtest/tests/r01091.vtc
index dbf3820..f50274f 100644
--- a/bin/varnishtest/tests/r01091.vtc
+++ b/bin/varnishtest/tests/r01091.vtc
@@ -3,9 +3,6 @@ varnishtest "Test fallback director with saint mode"
server s1 {
rxreq
txresp -hdr "Foo: 1"
- accept
- rxreq
- txresp -hdr "Foo: 1"
} -start
server s2 {
@@ -26,11 +23,18 @@ varnish v1 -vcl+backend {
set req.backend = f1.backend();
}
sub vcl_backend_response {
- if(req.restarts < 1) {
+ if (beresp.http.foo == "1") {
+ set beresp.uncacheable = true;
set beresp.saintmode = 1h;
- return(restart);
+ set beresp.status = 606;
+ return(deliver);
}
}
+ sub vcl_deliver {
+ if (resp.status == 606) {
+ return(restart);
+ }
+ }
} -start
client c1 {
More information about the varnish-commit
mailing list