[master] c67af5f5f disambiguate vcl_max

Nils Goroll nils.goroll at uplex.de
Thu Feb 13 09:15:09 UTC 2020


commit c67af5f5f8bb4cf95df14d7d0eb62f73955bdc7c
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Feb 13 10:08:15 2020 +0100

    disambiguate vcl_max
    
    we used vcl_max both for the max vcl version and the maximum number of
    vcls to load.

diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 8c0686597..2e1f6a69f 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -430,7 +430,8 @@ VCL_Open(const char *fn, struct vsb *msg)
 		(void)dlclose(dlh);
 		return (NULL);
 	}
-	if (cnf->syntax < heritage.min_vcl || cnf->syntax > heritage.max_vcl) {
+	if (cnf->syntax < heritage.min_vcl_version ||
+	    cnf->syntax > heritage.max_vcl_version) {
 		VSB_printf(msg, "Compiled VCL version (%.1f) not supported.\n",
 		    .1 * cnf->syntax);
 		(void)dlclose(dlh);
diff --git a/bin/varnishd/common/heritage.h b/bin/varnishd/common/heritage.h
index e3550ada6..d33fb4d3f 100644
--- a/bin/varnishd/common/heritage.h
+++ b/bin/varnishd/common/heritage.h
@@ -87,8 +87,8 @@ struct heritage {
 
 	struct vsmw			*proc_vsmw;
 
-	unsigned			min_vcl;
-	unsigned			max_vcl;
+	unsigned			min_vcl_version;
+	unsigned			max_vcl_version;
 };
 
 extern struct heritage heritage;
diff --git a/bin/varnishd/mgt/mgt_acceptor.c b/bin/varnishd/mgt/mgt_acceptor.c
index 1d513bc31..dd00d77bc 100644
--- a/bin/varnishd/mgt/mgt_acceptor.c
+++ b/bin/varnishd/mgt/mgt_acceptor.c
@@ -269,8 +269,8 @@ MAC_Arg(const char *spec)
 		ARGV_ERR("Unix domain socket addresses must be"
 		    " absolute paths in -a (%s)\n", la->endpoint);
 
-	if (*la->endpoint == '/' && heritage.min_vcl < 41)
-		heritage.min_vcl = 41;
+	if (*la->endpoint == '/' && heritage.min_vcl_version < 41)
+		heritage.min_vcl_version = 41;
 
 	for (int i = 2; av[i] != NULL; i++) {
 		char *eq, *val;
diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 4753ef69b..0b21c7c61 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -286,7 +286,7 @@ mgt_initialize(struct cli *cli)
 
 	MCF_InitParams(cli);
 
-	VCC_VCL_Range(&heritage.min_vcl, &heritage.max_vcl);
+	VCC_VCL_Range(&heritage.min_vcl_version, &heritage.max_vcl_version);
 
 	cli_check(cli);
 }


More information about the varnish-commit mailing list