]> err.no Git - varnish/commitdiff
Add "insert_pass" action in VCL
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 11 Jul 2006 16:03:25 +0000 (16:03 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 11 Jul 2006 16:03:25 +0000 (16:03 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@430 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/include/vcl_returns.h
varnish-cache/lib/libvcl/vcl_fixed_token.c
varnish-cache/lib/libvcl/vcl_gen_fixed_token.tcl
varnish-cache/lib/libvcl/vcl_token_defs.h

index 3cc8448f4f1dd78c8f2d6ff141f8b5510e6f9c9f..7867b89e0bd211c262395d41455530532fb9325d 100644 (file)
@@ -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
index 8f260f769a50c52859ffff4431b84f3c9d892adc..c1cdd96ab93e0a1511d3314b8360b09592095ca4 100644 (file)
@@ -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);
index c25d7d9bca93e3c5bffeb1a644e429cc70eca41c..b91967c551c5ce4323a62fb4ae132d868e3ed49c 100755 (executable)
@@ -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
index b3c2a02443d37265fbaaba5f4763c9f534ff1e2f..d5a2ec0d8071435a9b9f066b0999bc59b80d7fda 100644 (file)
 #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