Mailing List Archive

r1561 - in trunk/varnish-cache: include lib/libvcl
Author: phk
Date: 2007-06-25 14:38:20 +0200 (Mon, 25 Jun 2007)
New Revision: 1561

Modified:
trunk/varnish-cache/include/vcl_returns.h
trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
Log:
Give vcl_discard() valid return-actions "keep" and "discard".



Modified: trunk/varnish-cache/include/vcl_returns.h
===================================================================
--- trunk/varnish-cache/include/vcl_returns.h 2007-06-25 10:37:11 UTC (rev 1560)
+++ trunk/varnish-cache/include/vcl_returns.h 2007-06-25 12:38:20 UTC (rev 1561)
@@ -18,6 +18,7 @@
VCL_RET_MAC(insert, INSERT, (1 << 6), 6)
VCL_RET_MAC(deliver, DELIVER, (1 << 7), 7)
VCL_RET_MAC(discard, DISCARD, (1 << 8), 8)
+VCL_RET_MAC(keep, KEEP, (1 << 9), 9)
#else
#define VCL_RET_ERROR (1 << 0)
#define VCL_RET_LOOKUP (1 << 1)
@@ -28,7 +29,8 @@
#define VCL_RET_INSERT (1 << 6)
#define VCL_RET_DELIVER (1 << 7)
#define VCL_RET_DISCARD (1 << 8)
-#define VCL_RET_MAX 9
+#define VCL_RET_KEEP (1 << 9)
+#define VCL_RET_MAX 10
#endif

#ifdef VCL_MET_MAC
@@ -40,7 +42,7 @@
VCL_MET_MAC(hit,HIT,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_DELIVER))
VCL_MET_MAC(fetch,FETCH,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_INSERT))
VCL_MET_MAC(timeout,TIMEOUT,(VCL_RET_FETCH|VCL_RET_DISCARD))
-VCL_MET_MAC(discard,DISCARD,(VCL_RET_DISCARD|VCL_RET_PASS))
+VCL_MET_MAC(discard,DISCARD,(VCL_RET_DISCARD|VCL_RET_KEEP))
#else
#define VCL_MET_RECV (1 << 0)
#define VCL_MET_PIPE (1 << 1)

Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2007-06-25 10:37:11 UTC (rev 1560)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2007-06-25 12:38:20 UTC (rev 1561)
@@ -309,6 +309,7 @@
vsb_cat(sb, "#define VCL_RET_INSERT (1 << 6)\n");
vsb_cat(sb, "#define VCL_RET_DELIVER (1 << 7)\n");
vsb_cat(sb, "#define VCL_RET_DISCARD (1 << 8)\n");
+ vsb_cat(sb, "#define VCL_RET_KEEP (1 << 9)\n");
vsb_cat(sb, "/*\n");
vsb_cat(sb, " * $Id$\n");
vsb_cat(sb, " *\n");
@@ -482,6 +483,12 @@
vsb_cat(sb, "void VRT_l_obj_cacheable(struct sess *, unsigned);\n");
vsb_cat(sb, "double VRT_r_obj_ttl(struct sess *);\n");
vsb_cat(sb, "void VRT_l_obj_ttl(struct sess *, double);\n");
+ vsb_cat(sb, "const char * VRT_r_resp_proto(struct sess *);\n");
+ vsb_cat(sb, "void VRT_l_resp_proto(struct sess *, const char *);\n");
+ vsb_cat(sb, "int VRT_r_resp_status(struct sess *);\n");
+ vsb_cat(sb, "void VRT_l_resp_status(struct sess *, int);\n");
+ vsb_cat(sb, "const char * VRT_r_resp_response(struct sess *);\n");
+ vsb_cat(sb, "void VRT_l_resp_response(struct sess *, const char *);\n");
vsb_cat(sb, "const char * VRT_r_resp_http_(struct sess *);\n");
vsb_cat(sb, "void VRT_l_resp_http_(struct sess *, const char *);\n");
}

Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2007-06-25 10:37:11 UTC (rev 1560)
+++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2007-06-25 12:38:20 UTC (rev 1561)
@@ -42,7 +42,7 @@
{hit {error pass deliver}}
{fetch {error pass insert}}
{timeout {fetch discard}}
- {discard {discard pass}}
+ {discard {discard keep}}
}

# These are the return actions
@@ -57,6 +57,7 @@
insert
deliver
discard
+ keep
}

# Language keywords