From: phk Date: Mon, 25 Jun 2007 12:38:20 +0000 (+0000) Subject: Give vcl_discard() valid return-actions "keep" and "discard". X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39851133df0351c92aadc1332d8ce1284d06197e;p=varnish Give vcl_discard() valid return-actions "keep" and "discard". git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1561 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/include/vcl_returns.h b/varnish-cache/include/vcl_returns.h index 009cc3fb..848ec6ac 100644 --- a/varnish-cache/include/vcl_returns.h +++ b/varnish-cache/include/vcl_returns.h @@ -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) diff --git a/varnish-cache/lib/libvcl/vcc_fixed_token.c b/varnish-cache/lib/libvcl/vcc_fixed_token.c index e2b17b77..b144b982 100644 --- a/varnish-cache/lib/libvcl/vcc_fixed_token.c +++ b/varnish-cache/lib/libvcl/vcc_fixed_token.c @@ -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"); } diff --git a/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl b/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl index 8c2d6977..7657dd1a 100755 --- a/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl +++ b/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl @@ -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