From: phk Date: Tue, 11 Jul 2006 16:03:25 +0000 (+0000) Subject: Add "insert_pass" action in VCL X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7158e9de68e3eb4795382f7f03c2e09e704991b;p=varnish Add "insert_pass" action in VCL git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@430 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/include/vcl_returns.h b/varnish-cache/include/vcl_returns.h index 3cc8448f..7867b89e 100644 --- a/varnish-cache/include/vcl_returns.h +++ b/varnish-cache/include/vcl_returns.h @@ -13,26 +13,28 @@ VCL_RET_MAC_E(error, ERROR, 0) VCL_RET_MAC(lookup, LOOKUP, (1 << 1)) VCL_RET_MAC(pipe, PIPE, (1 << 2)) VCL_RET_MAC(pass, PASS, (1 << 3)) -VCL_RET_MAC(fetch, FETCH, (1 << 4)) -VCL_RET_MAC(insert, INSERT, (1 << 5)) -VCL_RET_MAC(deliver, DELIVER, (1 << 6)) -VCL_RET_MAC(discard, DISCARD, (1 << 7)) +VCL_RET_MAC(insert_pass, INSERT_PASS, (1 << 4)) +VCL_RET_MAC(fetch, FETCH, (1 << 5)) +VCL_RET_MAC(insert, INSERT, (1 << 6)) +VCL_RET_MAC(deliver, DELIVER, (1 << 7)) +VCL_RET_MAC(discard, DISCARD, (1 << 8)) #else #define VCL_RET_ERROR (1 << 0) #define VCL_RET_LOOKUP (1 << 1) #define VCL_RET_PIPE (1 << 2) #define VCL_RET_PASS (1 << 3) -#define VCL_RET_FETCH (1 << 4) -#define VCL_RET_INSERT (1 << 5) -#define VCL_RET_DELIVER (1 << 6) -#define VCL_RET_DISCARD (1 << 7) -#define VCL_RET_MAX 8 +#define VCL_RET_INSERT_PASS (1 << 4) +#define VCL_RET_FETCH (1 << 5) +#define VCL_RET_INSERT (1 << 6) +#define VCL_RET_DELIVER (1 << 7) +#define VCL_RET_DISCARD (1 << 8) +#define VCL_RET_MAX 9 #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(miss,MISS,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_PIPE|VCL_RET_FETCH)) VCL_MET_MAC(hit,HIT,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_PIPE|VCL_RET_DELIVER)) -VCL_MET_MAC(fetch,FETCH,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_PIPE|VCL_RET_INSERT)) +VCL_MET_MAC(fetch,FETCH,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_PIPE|VCL_RET_INSERT|VCL_RET_INSERT_PASS)) VCL_MET_MAC(timeout,TIMEOUT,(VCL_RET_FETCH|VCL_RET_DISCARD)) #endif diff --git a/varnish-cache/lib/libvcl/vcl_fixed_token.c b/varnish-cache/lib/libvcl/vcl_fixed_token.c index 8f260f76..c1cdd96a 100644 --- a/varnish-cache/lib/libvcl/vcl_fixed_token.c +++ b/varnish-cache/lib/libvcl/vcl_fixed_token.c @@ -229,6 +229,13 @@ vcl_fixed_token(const char *p, const char **q) } return (0); case 'i': + if (p[0] == 'i' && p[1] == 'n' && p[2] == 's' && + p[3] == 'e' && p[4] == 'r' && p[5] == 't' && + p[6] == '_' && p[7] == 'p' && p[8] == 'a' && + p[9] == 's' && p[10] == 's' && !isvar(p[11])) { + *q = p + 11; + return (T_INSERT_PASS); + } if (p[0] == 'i' && p[1] == 'n' && p[2] == 's' && p[3] == 'e' && p[4] == 'r' && p[5] == 't' && !isvar(p[6])) { @@ -393,6 +400,7 @@ vcl_init_tnames(void) vcl_tnames[T_INC] = "++"; vcl_tnames[T_INCR] = "+="; vcl_tnames[T_INSERT] = "insert"; + vcl_tnames[T_INSERT_PASS] = "insert_pass"; vcl_tnames[T_LEQ] = "<="; vcl_tnames[T_LOOKUP] = "lookup"; vcl_tnames[T_MUL] = "*="; @@ -418,10 +426,11 @@ vcl_output_lang_h(FILE *f) fputs("#define VCL_RET_LOOKUP (1 << 1)\n", f); fputs("#define VCL_RET_PIPE (1 << 2)\n", f); fputs("#define VCL_RET_PASS (1 << 3)\n", f); - fputs("#define VCL_RET_FETCH (1 << 4)\n", f); - fputs("#define VCL_RET_INSERT (1 << 5)\n", f); - fputs("#define VCL_RET_DELIVER (1 << 6)\n", f); - fputs("#define VCL_RET_DISCARD (1 << 7)\n", f); + fputs("#define VCL_RET_INSERT_PASS (1 << 4)\n", f); + fputs("#define VCL_RET_FETCH (1 << 5)\n", f); + fputs("#define VCL_RET_INSERT (1 << 6)\n", f); + fputs("#define VCL_RET_DELIVER (1 << 7)\n", f); + fputs("#define VCL_RET_DISCARD (1 << 8)\n", f); fputs("/*\n", f); fputs(" * $Id$\n", f); fputs(" *\n", f); diff --git a/varnish-cache/lib/libvcl/vcl_gen_fixed_token.tcl b/varnish-cache/lib/libvcl/vcl_gen_fixed_token.tcl index c25d7d9b..b91967c5 100755 --- a/varnish-cache/lib/libvcl/vcl_gen_fixed_token.tcl +++ b/varnish-cache/lib/libvcl/vcl_gen_fixed_token.tcl @@ -10,7 +10,7 @@ set methods { {recv {error pass pipe lookup}} {miss {error pass pipe fetch}} {hit {error pass pipe deliver}} - {fetch {error pass pipe insert}} + {fetch {error pass pipe insert insert_pass}} {timeout {fetch discard}} } @@ -21,6 +21,7 @@ set returns { lookup pipe pass + insert_pass fetch insert deliver diff --git a/varnish-cache/lib/libvcl/vcl_token_defs.h b/varnish-cache/lib/libvcl/vcl_token_defs.h index b3c2a024..d5a2ec0d 100644 --- a/varnish-cache/lib/libvcl/vcl_token_defs.h +++ b/varnish-cache/lib/libvcl/vcl_token_defs.h @@ -26,27 +26,28 @@ #define T_LOOKUP 144 #define T_PIPE 145 #define T_PASS 146 -#define T_FETCH 147 -#define T_INSERT 148 -#define T_DELIVER 149 -#define T_DISCARD 150 -#define T_INC 151 -#define T_DEC 152 -#define T_CAND 153 -#define T_COR 154 -#define T_LEQ 155 -#define T_EQ 156 -#define T_NEQ 157 -#define T_GEQ 158 -#define T_SHR 159 -#define T_SHL 160 -#define T_INCR 161 -#define T_DECR 162 -#define T_MUL 163 -#define T_DIV 164 -#define ID 165 -#define VAR 166 -#define CNUM 167 -#define CSTR 168 -#define EOI 169 -#define METHOD 170 +#define T_INSERT_PASS 147 +#define T_FETCH 148 +#define T_INSERT 149 +#define T_DELIVER 150 +#define T_DISCARD 151 +#define T_INC 152 +#define T_DEC 153 +#define T_CAND 154 +#define T_COR 155 +#define T_LEQ 156 +#define T_EQ 157 +#define T_NEQ 158 +#define T_GEQ 159 +#define T_SHR 160 +#define T_SHL 161 +#define T_INCR 162 +#define T_DECR 163 +#define T_MUL 164 +#define T_DIV 165 +#define ID 166 +#define VAR 167 +#define CNUM 168 +#define CSTR 169 +#define EOI 170 +#define METHOD 171