Permalink
Browse files

Add beresp.uncacheable (will replace beresp.do_pass) and obj.uncacheable

variables.
  • Loading branch information...
bsdphk committed Apr 3, 2013
1 parent 6c6a41a commit 20bb2a0b0da9100c070a575da17c2c411f542903
@@ -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)
/*--------------------------------------------------------------------*/
@@ -553,6 +554,14 @@ VRT_r_obj_lastuse(const struct req *req)
return (VTIM_real() - req->obj->last_use);
}
+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)
{
@@ -11,7 +11,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_response {
- set beresp.do_pass = true;
+ set beresp.uncacheable = true;
}
} -start
@@ -15,7 +15,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_response {
- set beresp.do_pass = true;
+ set beresp.uncacheable = true;
}
} -start
@@ -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
@@ -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
@@ -40,7 +40,7 @@ server s1 -start
varnish v1 -vcl+backend {
sub vcl_response {
- set beresp.do_pass = true;
+ set beresp.uncacheable = true;
}
}
View
@@ -345,6 +345,12 @@
( 'response',),
'const struct req *'
),
+ ('beresp.uncacheable',
+ 'BOOL',
+ ( 'response',),
+ ( 'response',),
+ 'const struct req *'
+ ),
('beresp.ttl',
'DURATION',
( 'response',),
@@ -441,6 +447,12 @@
( ),
'const struct req *'
),
+ ('obj.uncacheable',
+ 'BOOL',
+ ( 'lookup', 'deliver', 'error',),
+ ( ),
+ 'const struct req *'
+ ),
('resp.proto',
'STRING',
( 'deliver',),

0 comments on commit 20bb2a0

Please sign in to comment.