" }\n"
" insert;\n"
"}\n"
+ "sub vcl_timeout {\n"
+ " discard;\n"
+ "}\n"
"", bflag);
assert(buf != NULL);
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
vcl_func_f *miss_func;
vcl_func_f *hit_func;
vcl_func_f *fetch_func;
+ vcl_func_f *timeout_func;
};
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))
#else
#define VCL_RET_ERROR (1 << 0)
#define VCL_RET_LOOKUP (1 << 1)
#define VCL_RET_FETCH (1 << 4)
#define VCL_RET_INSERT (1 << 5)
#define VCL_RET_DELIVER (1 << 6)
-#define VCL_RET_MAX 7
+#define VCL_RET_DISCARD (1 << 7)
+#define VCL_RET_MAX 8
#endif
#ifdef VCL_MET_MAC
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(timeout,TIMEOUT,(VCL_RET_FETCH|VCL_RET_DISCARD))
#endif
}
return (0);
case 'd':
+ if (p[0] == 'd' && p[1] == 'i' && p[2] == 's' &&
+ p[3] == 'c' && p[4] == 'a' && p[5] == 'r' &&
+ p[6] == 'd' && !isvar(p[7])) {
+ *q = p + 7;
+ return (T_DISCARD);
+ }
if (p[0] == 'd' && p[1] == 'e' && p[2] == 'l' &&
p[3] == 'i' && p[4] == 'v' && p[5] == 'e' &&
p[6] == 'r' && !isvar(p[7])) {
vcl_tnames[T_DEC] = "--";
vcl_tnames[T_DECR] = "/=";
vcl_tnames[T_DELIVER] = "deliver";
+ vcl_tnames[T_DISCARD] = "discard";
vcl_tnames[T_DIV] = "/=";
vcl_tnames[T_ELSE] = "else";
vcl_tnames[T_ELSEIF] = "elseif";
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("/*\n", f);
fputs(" * $Id$\n", f);
fputs(" *\n", f);
fputs(" vcl_func_f *miss_func;\n", f);
fputs(" vcl_func_f *hit_func;\n", f);
fputs(" vcl_func_f *fetch_func;\n", f);
+ fputs(" vcl_func_f *timeout_func;\n", f);
fputs("};\n", f);
fputs("/*\n", f);
fputs(" * $Id$ \n", f);
# Second element is list of valid return actions.
#
set methods {
- {recv {error pass pipe lookup}}
- {miss {error pass pipe fetch}}
- {hit {error pass pipe deliver}}
- {fetch {error pass pipe insert}}
+ {recv {error pass pipe lookup}}
+ {miss {error pass pipe fetch}}
+ {hit {error pass pipe deliver}}
+ {fetch {error pass pipe insert}}
+ {timeout {fetch discard}}
}
# These are the return actions
fetch
insert
deliver
+ discard
}
# Language keywords
#define T_FETCH 147
#define T_INSERT 148
#define T_DELIVER 149
-#define T_INC 150
-#define T_DEC 151
-#define T_CAND 152
-#define T_COR 153
-#define T_LEQ 154
-#define T_EQ 155
-#define T_NEQ 156
-#define T_GEQ 157
-#define T_SHR 158
-#define T_SHL 159
-#define T_INCR 160
-#define T_DECR 161
-#define T_MUL 162
-#define T_DIV 163
-#define ID 164
-#define VAR 165
-#define CNUM 166
-#define CSTR 167
-#define EOI 168
-#define METHOD 169
+#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