[master] 20bb2a0 Add beresp.uncacheable (will replace beresp.do_pass) and obj.uncacheable variables.
Poul-Henning Kamp
phk at varnish-cache.org
Wed Apr 3 12:58:49 CEST 2013
commit 20bb2a0b0da9100c070a575da17c2c411f542903
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Apr 3 10:58:20 2013 +0000
Add beresp.uncacheable (will replace beresp.do_pass) and obj.uncacheable
variables.
diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index f724054..b40e2e0 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -202,6 +202,7 @@ VBERESP(beresp, unsigned, do_gzip, busyobj->do_gzip)
VBERESP(beresp, unsigned, do_gunzip, busyobj->do_gunzip)
VBERESP(beresp, unsigned, do_stream, busyobj->do_stream)
VBERESP(beresp, unsigned, do_pass, busyobj->do_pass)
+VBERESP(beresp, unsigned, uncacheable, busyobj->do_pass)
/*--------------------------------------------------------------------*/
@@ -554,6 +555,14 @@ VRT_r_obj_lastuse(const struct req *req)
}
unsigned
+VRT_r_obj_uncacheable(const struct req *req)
+{
+ CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
+ CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
+ return (req->obj->objcore->flags & OC_F_PASS ? 1 : 0);
+}
+
+unsigned
VRT_r_req_backend_healthy(const struct req *req)
{
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
diff --git a/bin/varnishtest/tests/c00011.vtc b/bin/varnishtest/tests/c00011.vtc
index 3145575..4a1391d 100644
--- a/bin/varnishtest/tests/c00011.vtc
+++ b/bin/varnishtest/tests/c00011.vtc
@@ -11,7 +11,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_response {
- set beresp.do_pass = true;
+ set beresp.uncacheable = true;
}
} -start
diff --git a/bin/varnishtest/tests/c00014.vtc b/bin/varnishtest/tests/c00014.vtc
index aefd1ce..c995511 100644
--- a/bin/varnishtest/tests/c00014.vtc
+++ b/bin/varnishtest/tests/c00014.vtc
@@ -15,7 +15,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_response {
- set beresp.do_pass = true;
+ set beresp.uncacheable = true;
}
} -start
diff --git a/bin/varnishtest/tests/e00011.vtc b/bin/varnishtest/tests/e00011.vtc
index 8d129b8..6c0a8ef 100644
--- a/bin/varnishtest/tests/e00011.vtc
+++ b/bin/varnishtest/tests/e00011.vtc
@@ -17,7 +17,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_response {
- set beresp.do_pass = true;
+ set beresp.uncacheable = true;
set beresp.do_esi = true;
}
} -start
diff --git a/bin/varnishtest/tests/r00318.vtc b/bin/varnishtest/tests/r00318.vtc
index bdcdb2f..86b7672 100644
--- a/bin/varnishtest/tests/r00318.vtc
+++ b/bin/varnishtest/tests/r00318.vtc
@@ -8,7 +8,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_response {
set beresp.do_esi = true;
- set beresp.do_pass = true;
+ set beresp.uncacheable = true;
}
} -start
diff --git a/bin/varnishtest/tests/r01206.vtc b/bin/varnishtest/tests/r01206.vtc
index 2dc3b6e..35aa8af 100644
--- a/bin/varnishtest/tests/r01206.vtc
+++ b/bin/varnishtest/tests/r01206.vtc
@@ -40,7 +40,7 @@ server s1 -start
varnish v1 -vcl+backend {
sub vcl_response {
- set beresp.do_pass = true;
+ set beresp.uncacheable = true;
}
}
diff --git a/lib/libvcl/generate.py b/lib/libvcl/generate.py
index f5387d9..df86279 100755
--- a/lib/libvcl/generate.py
+++ b/lib/libvcl/generate.py
@@ -345,6 +345,12 @@ sp_variables = (
( 'response',),
'const struct req *'
),
+ ('beresp.uncacheable',
+ 'BOOL',
+ ( 'response',),
+ ( 'response',),
+ 'const struct req *'
+ ),
('beresp.ttl',
'DURATION',
( 'response',),
@@ -441,6 +447,12 @@ sp_variables = (
( ),
'const struct req *'
),
+ ('obj.uncacheable',
+ 'BOOL',
+ ( 'lookup', 'deliver', 'error',),
+ ( ),
+ 'const struct req *'
+ ),
('resp.proto',
'STRING',
( 'deliver',),
More information about the varnish-commit
mailing list