From: phk Date: Sun, 30 Sep 2007 20:36:16 +0000 (+0000) Subject: Add "restart" action for most VCL methods. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e730054aa22309781abdb418618327da9e29e2a;p=varnish Add "restart" action for most VCL methods. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2065 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/include/vcl_returns.h b/varnish-cache/include/vcl_returns.h index 4f3f53a9..76ad3f6a 100644 --- a/varnish-cache/include/vcl_returns.h +++ b/varnish-cache/include/vcl_returns.h @@ -19,6 +19,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) +VCL_RET_MAC(restart, RESTART, (1 << 10), 10) #else #define VCL_RET_ERROR (1 << 0) #define VCL_RET_LOOKUP (1 << 1) @@ -30,18 +31,19 @@ VCL_RET_MAC(keep, KEEP, (1 << 9), 9) #define VCL_RET_DELIVER (1 << 7) #define VCL_RET_DISCARD (1 << 8) #define VCL_RET_KEEP (1 << 9) -#define VCL_RET_MAX 10 +#define VCL_RET_RESTART (1 << 10) +#define VCL_RET_MAX 11 #endif #ifdef VCL_MET_MAC -VCL_MET_MAC(recv,RECV,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_PIPE|VCL_RET_LOOKUP)) -VCL_MET_MAC(pipe,PIPE,(VCL_RET_ERROR|VCL_RET_PIPE)) -VCL_MET_MAC(pass,PASS,(VCL_RET_ERROR|VCL_RET_PASS)) +VCL_MET_MAC(recv,RECV,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_PIPE|VCL_RET_LOOKUP)) +VCL_MET_MAC(pipe,PIPE,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PIPE)) +VCL_MET_MAC(pass,PASS,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS)) VCL_MET_MAC(hash,HASH,(VCL_RET_HASH)) -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(deliver,DELIVER,(VCL_RET_ERROR|VCL_RET_DELIVER)) +VCL_MET_MAC(miss,MISS,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_FETCH)) +VCL_MET_MAC(hit,HIT,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_DELIVER)) +VCL_MET_MAC(fetch,FETCH,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_INSERT)) +VCL_MET_MAC(deliver,DELIVER,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_DELIVER)) VCL_MET_MAC(timeout,TIMEOUT,(VCL_RET_FETCH|VCL_RET_DISCARD)) VCL_MET_MAC(discard,DISCARD,(VCL_RET_DISCARD|VCL_RET_KEEP)) #else diff --git a/varnish-cache/lib/libvcl/vcc_fixed_token.c b/varnish-cache/lib/libvcl/vcc_fixed_token.c index 7f0643c8..3885cabc 100644 --- a/varnish-cache/lib/libvcl/vcc_fixed_token.c +++ b/varnish-cache/lib/libvcl/vcc_fixed_token.c @@ -330,6 +330,7 @@ vcl_output_lang_h(struct vsb *sb) 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, "#define VCL_RET_RESTART (1 << 10)\n"); vsb_cat(sb, "/*\n"); vsb_cat(sb, " * $Id$\n"); vsb_cat(sb, " *\n"); diff --git a/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl b/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl index 8b04deb3..578d70db 100755 --- a/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl +++ b/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl @@ -34,14 +34,14 @@ # Second element is list of valid return actions. # set methods { - {recv {error pass pipe lookup}} - {pipe {error pipe}} - {pass {error pass}} + {recv {error restart pass pipe lookup}} + {pipe {error restart pipe}} + {pass {error restart pass}} {hash {hash}} - {miss {error pass fetch}} - {hit {error pass deliver}} - {fetch {error pass insert}} - {deliver {error deliver}} + {miss {error restart pass fetch}} + {hit {error restart pass deliver}} + {fetch {error restart pass insert}} + {deliver {error restart deliver}} {timeout {fetch discard}} {discard {discard keep}} } @@ -59,6 +59,7 @@ set returns { deliver discard keep + restart } # Language keywords