Commit 97bb1716 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Give vcl_discard() valid return-actions "keep" and "discard".



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1561 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent a82e4c23
......@@ -18,6 +18,7 @@ VCL_RET_MAC(fetch, FETCH, (1 << 5), 5)
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 @@ VCL_RET_MAC(discard, DISCARD, (1 << 8), 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(miss,MISS,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_FETCH))
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)
......
......@@ -309,6 +309,7 @@ vcl_output_lang_h(struct vsb *sb)
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 @@ vcl_output_lang_h(struct vsb *sb)
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");
}
......@@ -42,7 +42,7 @@ set methods {
{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 @@ set returns {
insert
deliver
discard
keep
}
# Language keywords
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment