[4.1] e90f5d7 Save the VCL syntax version, we will need it later on.

Lasse Karstensen lkarsten at varnish-software.com
Tue Jun 14 12:00:16 CEST 2016


commit e90f5d70f37216a3e5cb86e98224ea7b5f6ac71c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu May 19 09:59:45 2016 +0000

    Save the VCL syntax version, we will need it later on.

diff --git a/lib/libvcc/vcc_compile.h b/lib/libvcc/vcc_compile.h
index 5da3d53..a4d3012 100644
--- a/lib/libvcc/vcc_compile.h
+++ b/lib/libvcc/vcc_compile.h
@@ -172,6 +172,7 @@ struct vcp {
 struct vcc {
 	unsigned		magic;
 #define VCC_MAGIC		0x24ad719d
+	float			syntax;
 
 	/* Parameter/Template section */
 	const struct vcp	*param;
diff --git a/lib/libvcc/vcc_parse.c b/lib/libvcc/vcc_parse.c
index 8a94749..811c90f 100644
--- a/lib/libvcc/vcc_parse.c
+++ b/lib/libvcc/vcc_parse.c
@@ -291,17 +291,17 @@ vcc_ParseDirector(struct vcc *tl)
 static void
 vcc_ParseVcl(struct vcc *tl)
 {
-	double ver;
 	struct token *tok;
 
 	assert(vcc_IdIs(tl->t, "vcl"));
 	vcc_NextToken(tl);
 	tok = tl->t;
-	ver = vcc_DoubleVal(tl);
+	tl->syntax = vcc_DoubleVal(tl);
 	ERRCHK(tl);
-	if (ver != 4.0) {
+	if (tl->syntax != 4.0) {
 		// see TODO above
-		VSB_printf(tl->sb, "VCL version %.1f not supported.\n", ver);
+		VSB_printf(tl->sb, "VCL version %.1f not supported.\n",
+		    tl->syntax);
 		vcc_ErrWhere(tl, tok);
 		ERRCHK(tl);
 	}



More information about the varnish-commit mailing list