[master] 97a2a9e Lay down some work for HFP mkII
Poul-Henning Kamp
phk at FreeBSD.org
Tue Oct 11 22:31:05 CEST 2016
commit 97a2a9efef26a9006751ad12e33c9b54057d1165
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Oct 11 20:30:03 2016 +0000
Lay down some work for HFP mkII
diff --git a/include/vrt.h b/include/vrt.h
index 901e13f..8aaa551 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -287,6 +287,7 @@ void VRT_purge(VRT_CTX, double ttl, double grace, double keep);
void VRT_count(VRT_CTX, unsigned);
void VRT_synth(VRT_CTX, unsigned, const char *);
+void VRT_hit_for_pass(VRT_CTX, VCL_DURATION);
struct http *VRT_selecthttp(VRT_CTX, enum gethdr_e);
const char *VRT_GetHdr(VRT_CTX, const struct gethdr_s *);
diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c
index ced924c..60525a7 100644
--- a/lib/libvcc/vcc_action.c
+++ b/lib/libvcc/vcc_action.c
@@ -192,6 +192,23 @@ parse_hash_data(struct vcc *tl)
/*--------------------------------------------------------------------*/
static void
+parse_return_pass(struct vcc *tl)
+{
+
+ ExpectErr(tl, '(');
+ vcc_NextToken(tl);
+ Fb(tl, 1, "VRT_hit_for_pass(ctx,\n");
+ tl->indent += INDENT;
+ vcc_Expr(tl, DURATION);
+ ERRCHK(tl);
+ ExpectErr(tl, ')');
+ vcc_NextToken(tl);
+ Fb(tl, 1, ");\n");
+ tl->indent -= INDENT;
+}
+/*--------------------------------------------------------------------*/
+
+static void
parse_return_synth(struct vcc *tl)
{
@@ -272,7 +289,7 @@ parse_return(struct vcc *tl)
hand = VCL_RET_MAX;
h = NULL;
-#define VCL_RET_MAC(l, U, B) \
+#define VCL_RET_MAC(l, U, B) \
if (vcc_IdIs(tl->t, #l)) { \
hand = VCL_RET_ ## U; \
h = #U; \
@@ -285,7 +302,7 @@ parse_return(struct vcc *tl)
ERRCHK(tl);
}
assert(hand < VCL_RET_MAX);
-
+
vcc_ProcAction(tl->curproc, hand, tl->t);
vcc_NextToken(tl);
if (tl->t->tok == '(') {
@@ -293,6 +310,8 @@ parse_return(struct vcc *tl)
parse_return_synth(tl);
else if (hand == VCL_RET_VCL)
parse_return_vcl(tl);
+ else if (hand == VCL_RET_PASS)
+ parse_return_pass(tl);
else {
VSB_printf(tl->sb, "Arguments not allowed.\n");
vcc_ErrWhere(tl, tl->t);
More information about the varnish-commit
mailing list