r4149 - in branches/sky/response/varnish-cache: bin/varnishd include lib/libvcl

sky at projects.linpro.no sky at projects.linpro.no
Tue Jul 28 15:30:49 CEST 2009


Author: sky
Date: 2009-07-28 15:30:49 +0200 (Tue, 28 Jul 2009)
New Revision: 4149

Modified:
   branches/sky/response/varnish-cache/bin/varnishd/cache_center.c
   branches/sky/response/varnish-cache/bin/varnishd/default.vcl
   branches/sky/response/varnish-cache/bin/varnishd/steps.h
   branches/sky/response/varnish-cache/include/vcl.h
   branches/sky/response/varnish-cache/include/vcl_returns.h
   branches/sky/response/varnish-cache/lib/libvcl/vcc_fixed_token.c
   branches/sky/response/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
   branches/sky/response/varnish-cache/lib/libvcl/vcc_gen_obj.tcl
   branches/sky/response/varnish-cache/lib/libvcl/vcc_obj.c
Log:
implement a resp/vcl_resp function callable from response (maybe should callable from miss/hit) lets you do synthetic responses without abusing vcl_error

Modified: branches/sky/response/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- branches/sky/response/varnish-cache/bin/varnishd/cache_center.c	2009-07-28 10:24:10 UTC (rev 4148)
+++ branches/sky/response/varnish-cache/bin/varnishd/cache_center.c	2009-07-28 13:30:49 UTC (rev 4149)
@@ -341,15 +341,21 @@
 	TIM_format(TIM_real(), date);
 	http_PrintfHeader(w, sp->fd, h, "Date: %s", date);
 	http_PrintfHeader(w, sp->fd, h, "Server: Varnish");
-	http_PrintfHeader(w, sp->fd, h, "Retry-After: %d", params->err_ttl);
+	if (sp->step != STP_RESP)
+		http_PrintfHeader(w, sp->fd, h, "Retry-After: %d", params->err_ttl);
 
 	if (sp->err_reason != NULL)
 		http_PutResponse(w, sp->fd, h, sp->err_reason);
 	else
 		http_PutResponse(w, sp->fd, h,
 		    http_StatusMessage(sp->err_code));
-	VCL_error_method(sp);
 
+	if (sp->step == STP_RESP) {
+		VCL_resp_method(sp);
+	} else {
+		VCL_error_method(sp);
+	}
+
 	if (sp->handling == VCL_RET_RESTART) {
 		HSH_Drop(sp);
 		sp->director = NULL;
@@ -359,7 +365,9 @@
 	}
 
 	/* We always close when we take this path */
-	sp->doclose = "error";
+	if (sp->step != STP_RESP)
+		sp->doclose = "error";
+	
 	sp->wantbody = 1;
 
 	assert(sp->handling == VCL_RET_DELIVER);
@@ -371,6 +379,26 @@
 }
 
 /*--------------------------------------------------------------------
+ * Emit a synthetic response without closing the connection
+ *
+DOT subgraph xcluster_resp {
+DOT	vcl_resp [
+DOT		shape=record
+DOT		label="vcl_resp()|resp|req"
+DOT	]
+DOT	RESP -> vcl_resp
+DOT	vcl_resp-> deliver [label=deliver]
+DOT }
+ */
+
+static int
+cnt_resp(struct sess *sp)
+{
+	sp->err_code = 200;
+	return cnt_error(sp);
+}
+
+/*--------------------------------------------------------------------
  * We have fetched the headers from the backend, ask the VCL code what
  * to do next, then head off in that direction.
  *
@@ -1013,6 +1041,9 @@
 		/* XXX: discard req body, if any */
 		sp->step = STP_ERROR;
 		return (0);
+	case VCL_RET_RESP:
+		sp->step = STP_RESP;
+		return (0);
 	default:
 		WRONG("Illegal action in vcl_recv{}");
 	}

Modified: branches/sky/response/varnish-cache/bin/varnishd/default.vcl
===================================================================
--- branches/sky/response/varnish-cache/bin/varnishd/default.vcl	2009-07-28 10:24:10 UTC (rev 4148)
+++ branches/sky/response/varnish-cache/bin/varnishd/default.vcl	2009-07-28 13:30:49 UTC (rev 4149)
@@ -134,3 +134,8 @@
 "};
     return (deliver);
 }
+
+sub vcl_resp {
+
+    return (deliver);
+}
\ No newline at end of file

Modified: branches/sky/response/varnish-cache/bin/varnishd/steps.h
===================================================================
--- branches/sky/response/varnish-cache/bin/varnishd/steps.h	2009-07-28 10:24:10 UTC (rev 4148)
+++ branches/sky/response/varnish-cache/bin/varnishd/steps.h	2009-07-28 13:30:49 UTC (rev 4149)
@@ -42,3 +42,4 @@
 STEP(deliver,	DELIVER)
 STEP(error,	ERROR)
 STEP(done,	DONE)
+STEP(resp,      RESP)

Modified: branches/sky/response/varnish-cache/include/vcl.h
===================================================================
--- branches/sky/response/varnish-cache/include/vcl.h	2009-07-28 10:24:10 UTC (rev 4148)
+++ branches/sky/response/varnish-cache/include/vcl.h	2009-07-28 13:30:49 UTC (rev 4149)
@@ -23,8 +23,9 @@
 #define VCL_MET_FETCH		(1 << 6)
 #define VCL_MET_DELIVER		(1 << 7)
 #define VCL_MET_ERROR		(1 << 8)
+#define VCL_MET_RESP		(1 << 9)
 
-#define VCL_MET_MAX		9
+#define VCL_MET_MAX		10
 
 /* VCL Returns */
 #define VCL_RET_ERROR		0
@@ -37,8 +38,9 @@
 #define VCL_RET_DISCARD		7
 #define VCL_RET_KEEP		8
 #define VCL_RET_RESTART		9
+#define VCL_RET_RESP		10
 
-#define VCL_RET_MAX		10
+#define VCL_RET_MAX		11
 
 struct VCL_conf {
 	unsigned	magic;
@@ -69,4 +71,5 @@
 	vcl_func_f	*fetch_func;
 	vcl_func_f	*deliver_func;
 	vcl_func_f	*error_func;
+	vcl_func_f	*resp_func;
 };

Modified: branches/sky/response/varnish-cache/include/vcl_returns.h
===================================================================
--- branches/sky/response/varnish-cache/include/vcl_returns.h	2009-07-28 10:24:10 UTC (rev 4148)
+++ branches/sky/response/varnish-cache/include/vcl_returns.h	2009-07-28 13:30:49 UTC (rev 4149)
@@ -17,11 +17,13 @@
 VCL_RET_MAC(discard, DISCARD)
 VCL_RET_MAC(keep, KEEP)
 VCL_RET_MAC(restart, RESTART)
+VCL_RET_MAC(resp, RESP)
 #endif
 
 #ifdef VCL_MET_MAC
 VCL_MET_MAC(recv,RECV,
      ((1 << VCL_RET_ERROR)
+    | (1 << VCL_RET_RESP)
     | (1 << VCL_RET_PASS)
     | (1 << VCL_RET_PIPE)
     | (1 << VCL_RET_LOOKUP)
@@ -64,4 +66,8 @@
      ((1 << VCL_RET_RESTART)
     | (1 << VCL_RET_DELIVER)
 ))
+VCL_MET_MAC(resp,RESP,
+     ((1 << VCL_RET_RESTART)
+    | (1 << VCL_RET_DELIVER)
+))
 #endif

Modified: branches/sky/response/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- branches/sky/response/varnish-cache/lib/libvcl/vcc_fixed_token.c	2009-07-28 10:24:10 UTC (rev 4148)
+++ branches/sky/response/varnish-cache/lib/libvcl/vcc_fixed_token.c	2009-07-28 13:30:49 UTC (rev 4149)
@@ -1,5 +1,5 @@
 /*
- * $Id: vcc_gen_fixed_token.tcl 4099 2009-06-08 21:40:48Z phk $
+ * $Id: vcc_gen_fixed_token.tcl 4100 2009-06-09 10:41:38Z phk $
  *
  * NB:  This file is machine generated, DO NOT EDIT!
  *
@@ -159,8 +159,8 @@
 
 	/* ../../include/vcl.h */
 
-	vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4099 2009-06-08 21");
-	vsb_cat(sb, ":40:48Z phk $\n *\n * NB:  This file is machine genera");
+	vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4100 2009-06-09 10");
+	vsb_cat(sb, ":41:38Z phk $\n *\n * NB:  This file is machine genera");
 	vsb_cat(sb, "ted, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixed_t");
 	vsb_cat(sb, "oken.tcl instead\n */\n\nstruct sess;\n");
 	vsb_cat(sb, "struct cli;\n\ntypedef void vcl_init_f(struct cli *);\n");
@@ -175,14 +175,16 @@
 	vsb_cat(sb, "#define VCL_MET_FETCH\t\t(1 << 6)\n");
 	vsb_cat(sb, "#define VCL_MET_DELIVER\t\t(1 << 7)\n");
 	vsb_cat(sb, "#define VCL_MET_ERROR\t\t(1 << 8)\n");
-	vsb_cat(sb, "\n#define VCL_MET_MAX\t\t9\n\n/* VCL Returns */\n");
-	vsb_cat(sb, "#define VCL_RET_ERROR\t\t0\n#define VCL_RET_LOOKUP\t\t");
-	vsb_cat(sb, "1\n#define VCL_RET_HASH\t\t2\n#define VCL_RET_PIPE\t\t");
-	vsb_cat(sb, "3\n#define VCL_RET_PASS\t\t4\n#define VCL_RET_FETCH\t\t");
-	vsb_cat(sb, "5\n#define VCL_RET_DELIVER\t\t6\n");
-	vsb_cat(sb, "#define VCL_RET_DISCARD\t\t7\n#define VCL_RET_KEEP\t\t");
-	vsb_cat(sb, "8\n#define VCL_RET_RESTART\t\t9\n");
-	vsb_cat(sb, "\n#define VCL_RET_MAX\t\t10\n\n");
+	vsb_cat(sb, "#define VCL_MET_RESP\t\t(1 << 9)\n");
+	vsb_cat(sb, "\n#define VCL_MET_MAX\t\t10\n\n");
+	vsb_cat(sb, "/* VCL Returns */\n#define VCL_RET_ERROR\t\t0\n");
+	vsb_cat(sb, "#define VCL_RET_LOOKUP\t\t1\n#define VCL_RET_HASH\t\t2");
+	vsb_cat(sb, "\n#define VCL_RET_PIPE\t\t3\n#define VCL_RET_PASS\t\t4");
+	vsb_cat(sb, "\n#define VCL_RET_FETCH\t\t5\n#define VCL_RET_DELIVER\t");
+	vsb_cat(sb, "\t6\n#define VCL_RET_DISCARD\t\t7\n");
+	vsb_cat(sb, "#define VCL_RET_KEEP\t\t8\n#define VCL_RET_RESTART\t\t");
+	vsb_cat(sb, "9\n#define VCL_RET_RESP\t\t10\n");
+	vsb_cat(sb, "\n#define VCL_RET_MAX\t\t11\n\n");
 	vsb_cat(sb, "struct VCL_conf {\n\tunsigned\tmagic;\n");
 	vsb_cat(sb, "#define VCL_CONF_MAGIC\t0x7406c509\t/* from /dev/rando");
 	vsb_cat(sb, "m */\n\n\tstruct director\t**director;\n");
@@ -197,7 +199,7 @@
 	vsb_cat(sb, "\tvcl_func_f\t*miss_func;\n\tvcl_func_f\t*hit_func;\n");
 	vsb_cat(sb, "\tvcl_func_f\t*fetch_func;\n\tvcl_func_f\t*deliver_fun");
 	vsb_cat(sb, "c;\n\tvcl_func_f\t*error_func;\n");
-	vsb_cat(sb, "};\n");
+	vsb_cat(sb, "\tvcl_func_f\t*resp_func;\n};\n");
 
 	/* ../../include/vrt.h */
 
@@ -319,8 +321,8 @@
 
 	/* ../../include/vrt_obj.h */
 
-	vsb_cat(sb, "/*\n * $Id: vcc_gen_obj.tcl 4066 2009-05-10 21:21:36Z ");
-	vsb_cat(sb, "sky $\n *\n * NB:  This file is machine generated, DO ");
+	vsb_cat(sb, "/*\n * $Id: vcc_gen_obj.tcl 4100 2009-06-09 10:41:38Z ");
+	vsb_cat(sb, "phk $\n *\n * NB:  This file is machine generated, DO ");
 	vsb_cat(sb, "NOT EDIT!\n *\n * Edit vcc_gen_obj.tcl instead\n");
 	vsb_cat(sb, " */\n\nstruct sockaddr * VRT_r_client_ip(const struct ");
 	vsb_cat(sb, "sess *);\nstruct sockaddr * VRT_r_server_ip(struct ses");

Modified: branches/sky/response/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
===================================================================
--- branches/sky/response/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl	2009-07-28 10:24:10 UTC (rev 4148)
+++ branches/sky/response/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl	2009-07-28 13:30:49 UTC (rev 4149)
@@ -34,7 +34,7 @@
 # Second element is list of valid return actions.
 #
 set methods {
-	{recv		{error pass pipe lookup}}
+	{recv		{error resp pass pipe lookup}}
 	{pipe		{error pipe}}
 	{pass		{error restart pass}}
 	{hash		{hash}}
@@ -43,6 +43,7 @@
 	{fetch		{error restart pass deliver}}
 	{deliver	{restart deliver}}
 	{error		{restart deliver}}
+	{resp		{restart deliver}}
 }
 
 # These are the return actions
@@ -58,6 +59,7 @@
 	discard
 	keep
 	restart
+	resp    
 }
 
 # Language keywords

Modified: branches/sky/response/varnish-cache/lib/libvcl/vcc_gen_obj.tcl
===================================================================
--- branches/sky/response/varnish-cache/lib/libvcl/vcc_gen_obj.tcl	2009-07-28 10:24:10 UTC (rev 4148)
+++ branches/sky/response/varnish-cache/lib/libvcl/vcc_gen_obj.tcl	2009-07-28 13:30:49 UTC (rev 4149)
@@ -38,7 +38,7 @@
     # Connection related parameters
     { client.ip
 	RO IP
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"const struct sess *"
     }
     { client.bandwidth				 # Not implemented yet
@@ -48,47 +48,47 @@
     }
     { server.ip
 	RO IP
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"struct sess *"
     }
     { server.hostname
 	RO STRING
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"struct sess *"
     }
     { server.identity
 	RO STRING
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"struct sess *"
     }
     { server.port
 	RO INT
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"struct sess *"
     }
     # Request paramters
     { req.request
 	RW STRING
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"const struct sess *"
     }
     { req.url
 	RW STRING
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"const struct sess *"
     }
     { req.proto
 	RW STRING
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"const struct sess *"
     }
     { req.http.
 	RW HDR_REQ
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"const struct sess *"
     }
 
-    # Possibly misnamed, not really part of the request
+    # Possibly misnamed, not really part of the request resp
     { req.hash
 	WO HASH
 	{               hash                                       error }
@@ -96,12 +96,12 @@
     }
     { req.backend
 	RW BACKEND
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"struct sess *"
     }
     { req.restarts
 	RO INT
-	{recv pipe pass hash miss hit fetch deliver                error }
+	{recv pipe pass hash miss hit fetch deliver resp           error }
 	"const struct sess *"
     }
     { req.grace
@@ -112,7 +112,7 @@
 
     { req.xid
 	RO STRING
-	{recv pipe pass hash miss hit fetch deliver		   error}
+	{recv pipe pass hash miss hit fetch deliver resp	   error}
 	"struct sess *"
     }
 
@@ -202,27 +202,27 @@
     # The (possibly) cached object
     { obj.proto
 	RW STRING
-	{                         hit                               error}
+	{                         hit       resp                    error}
 	"const struct sess *"
     }
     { obj.status
 	RW INT
-	{                                                           error}
+	{                                   resp                    error}
 	"const struct sess *"
     }
     { obj.response
 	RW STRING
-	{                                                           error}
+	{                                   resp                    error}
 	"const struct sess *"
     }
     { obj.hits
 	RO INT
-	{			  hit       deliver                      }
+	{			  hit       deliver   resp               }
 	"const struct sess *"
     }
     { obj.http.
 	RW HDR_OBJ
-	{                         hit       			    error}
+	{                         hit       	resp		    error}
 	"const struct sess *"
     }
 

Modified: branches/sky/response/varnish-cache/lib/libvcl/vcc_obj.c
===================================================================
--- branches/sky/response/varnish-cache/lib/libvcl/vcc_obj.c	2009-07-28 10:24:10 UTC (rev 4148)
+++ branches/sky/response/varnish-cache/lib/libvcl/vcc_obj.c	2009-07-28 13:30:49 UTC (rev 4149)
@@ -1,5 +1,5 @@
 /*
- * $Id: vcc_gen_obj.tcl 4099 2009-06-08 21:40:48Z phk $
+ * $Id: vcc_gen_obj.tcl 4100 2009-06-09 10:41:38Z phk $
  *
  * NB:  This file is machine generated, DO NOT EDIT!
  *
@@ -16,63 +16,63 @@
 	    V_RO,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "server.ip", IP, 9,
 	    "VRT_r_server_ip(sp)",	    NULL,
 	    V_RO,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "server.hostname", STRING, 15,
 	    "VRT_r_server_hostname(sp)",	    NULL,
 	    V_RO,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "server.identity", STRING, 15,
 	    "VRT_r_server_identity(sp)",	    NULL,
 	    V_RO,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "server.port", INT, 11,
 	    "VRT_r_server_port(sp)",	    NULL,
 	    V_RO,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "req.request", STRING, 11,
 	    "VRT_r_req_request(sp)",	    "VRT_l_req_request(sp, ",
 	    V_RW,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "req.url", STRING, 7,
 	    "VRT_r_req_url(sp)",	    "VRT_l_req_url(sp, ",
 	    V_RW,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "req.proto", STRING, 9,
 	    "VRT_r_req_proto(sp)",	    "VRT_l_req_proto(sp, ",
 	    V_RW,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "req.http.", HEADER, 9,
 	    "VRT_r_req_http_(sp)",	    "VRT_l_req_http_(sp, ",
 	    V_RW,	    "HDR_REQ",
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "req.hash", HASH, 8,
 	    NULL,	    "VRT_l_req_hash(sp, ",
@@ -84,14 +84,14 @@
 	    V_RW,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "req.restarts", INT, 12,
 	    "VRT_r_req_restarts(sp)",	    NULL,
 	    V_RO,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "req.grace", TIME, 9,
 	    "VRT_r_req_grace(sp)",	    "VRT_l_req_grace(sp, ",
@@ -105,7 +105,7 @@
 	    V_RO,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	     | VCL_MET_ERROR
+	     | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "req.esi", BOOL, 7,
 	    "VRT_r_req_esi(sp)",	    "VRT_l_req_esi(sp, ",
@@ -185,27 +185,27 @@
 	{ "obj.proto", STRING, 9,
 	    "VRT_r_obj_proto(sp)",	    "VRT_l_obj_proto(sp, ",
 	    V_RW,	    0,
-	    VCL_MET_HIT | VCL_MET_ERROR
+	    VCL_MET_HIT | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "obj.status", INT, 10,
 	    "VRT_r_obj_status(sp)",	    "VRT_l_obj_status(sp, ",
 	    V_RW,	    0,
-	    VCL_MET_ERROR
+	    VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "obj.response", STRING, 12,
 	    "VRT_r_obj_response(sp)",	    "VRT_l_obj_response(sp, ",
 	    V_RW,	    0,
-	    VCL_MET_ERROR
+	    VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "obj.hits", INT, 8,
 	    "VRT_r_obj_hits(sp)",	    NULL,
 	    V_RO,	    0,
-	    VCL_MET_HIT | VCL_MET_DELIVER
+	    VCL_MET_HIT | VCL_MET_DELIVER | VCL_MET_RESP
 	},
 	{ "obj.http.", HEADER, 9,
 	    "VRT_r_obj_http_(sp)",	    "VRT_l_obj_http_(sp, ",
 	    V_RW,	    "HDR_OBJ",
-	    VCL_MET_HIT | VCL_MET_ERROR
+	    VCL_MET_HIT | VCL_MET_RESP | VCL_MET_ERROR
 	},
 	{ "obj.cacheable", BOOL, 13,
 	    "VRT_r_obj_cacheable(sp)",	    "VRT_l_obj_cacheable(sp, ",



More information about the varnish-commit mailing list