[4.0] 1588b75 Make obj.uncacheable available in vcl_deliver

Lasse Karstensen lkarsten at varnish-software.com
Thu Jan 15 16:35:41 CET 2015


commit 1588b755323e13a1566d2a9ef085ae0efba3effb
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Mon Nov 10 11:43:32 2014 +0000

    Make obj.uncacheable available in vcl_deliver
    
    With this is possible to find out whether the request was a pass (or
    hit-for-pass) in a single place.

diff --git a/bin/varnishtest/tests/v00025.vtc b/bin/varnishtest/tests/v00025.vtc
index 2ac4b9d..c473a21 100644
--- a/bin/varnishtest/tests/v00025.vtc
+++ b/bin/varnishtest/tests/v00025.vtc
@@ -22,6 +22,7 @@ varnish v1 -arg "-i J.F.Nobody" -vcl+backend {
 		set resp.http.esi = req.esi;
 		set resp.http.be = req.backend_hint;
 		set resp.http.c_id = client.identity;
+		if (obj.uncacheable) { }
 	}
 
 	sub vcl_backend_response {
@@ -41,7 +42,6 @@ varnish v1 -arg "-i J.F.Nobody" -vcl+backend {
 	sub vcl_hit {
 		if (obj.proto) { }
 		if (obj.reason) { }
-		if (obj.uncacheable) { }
 		if (obj.keep > 1m) { }
 		if (obj.grace < 3m) {
 			return (deliver);
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index 10ab8d3..4a7bdde 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -593,9 +593,9 @@ sp_variables = [
 	),
 	('obj.uncacheable',
 		'BOOL',
-		( 'hit', ),
+		( 'deliver', ),
 		( ), """
-		Whether the object is uncacheable (aka hit-for-pass)
+		Whether the object is uncacheable (pass or hit-for-pass).
 		"""
 	),
 	('resp',



More information about the varnish-commit mailing list