[master] 15b166f02 Remove old special-case handling of `-l` argument errors.

Poul-Henning Kamp phk at FreeBSD.org
Tue Feb 1 13:46:06 UTC 2022


commit 15b166f02c2065de108fe0aed46ad66b28c07a56
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Feb 1 13:44:15 2022 +0000

    Remove old special-case handling of `-l` argument errors.

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 0df2806c0..4f65216ce 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -560,7 +560,6 @@ main(int argc, char * const *argv)
 	const char *T_arg = "localhost:0";
 	char *p;
 	struct cli cli[1];
-	char **av;
 	const char *err;
 	unsigned u;
 	struct sigaction sac;
@@ -734,22 +733,8 @@ main(int argc, char * const *argv)
 			VJ_master(JAIL_MASTER_LOW);
 			break;
 		case 'l':
-			av = VAV_Parse(optarg, NULL, ARGV_COMMA);
-			AN(av);
-			if (av[0] != NULL)
-				ARGV_ERR("-l ...: %s\n", av[0]);
-			if (av[1] != NULL && av[2] != NULL && av[3] != NULL)
-				ARGV_ERR("Too many sub arguments to -l\n");
-			if (av[1] != NULL) {
-				MCF_ParamSet(cli, "vsl_space", av[1]);
-				cli_check(cli);
-			}
-			if (av[1] != NULL && av[2] != NULL) {
-				fprintf(stderr,
-				    "Warning: Ignoring deprecated second"
-				    " subargument to -l\n");
-			}
-			VAV_Free(av);
+			MCF_ParamSet(cli, "vsl_space", optarg);
+			cli_check(cli);
 			break;
 		case 'M':
 			M_arg = optarg;
diff --git a/bin/varnishtest/tests/u00000.vtc b/bin/varnishtest/tests/u00000.vtc
index a800b8a2c..e568f4adb 100644
--- a/bin/varnishtest/tests/u00000.vtc
+++ b/bin/varnishtest/tests/u00000.vtc
@@ -52,12 +52,6 @@ shell -err -expect {Cannot create secret-file in} {
 
 shell -err -expect {Unknown jail method "xyz"} "varnishd -jxyz -f '' "
 
-shell -err -expect {Invalid backslash sequence} {
-	varnishd -l 'xyz\kk,xyz\foo' -f ''
-}
-shell -err -expect {Invalid backslash sequence} {
-	varnishd -l 'ab\8cd' -f ''
-}
 shell -err -expect {Too many arguments for -V} "varnishd -V -V"
 shell -expect {Copyright (c) 2006} "varnishd -V"
 
@@ -82,19 +76,7 @@ shell -err -expect {Error: -I file CLI command failed (104)} {
 }
 
 shell -err -expect "Can't open non-existent" {
-	varnishd -f '' -I non-existent -n ${tmpdir}/v0 -a :0 -l '2m,"'
-}
-
-shell -err -expect {Error: -l ...: Missing '"'} {
-	varnishd -f '' -I foo -n ${tmpdir}/v0 -a :0 -l '2m,"'
-}
-
-shell -err -expect {Error: Too many sub arguments} {
-	varnishd -f '' -I foo -n ${tmpdir}/v0 -a :0 -l 2m,2m,2m
-}
-
-shell -err -expect {Warning: Ignoring deprecated second subargument} {
-	varnishd -f '' -I foo -n ${tmpdir}/v0 -a :0 -l 2m,2m
+	varnishd -f '' -I non-existent -n ${tmpdir}/v0 -a :0
 }
 
 
@@ -103,9 +85,8 @@ shell -err -expect {Warning: Ignoring deprecated second subargument} {
 # Test -F mode with no VCL loaded
 
 shell {echo ping > ${tmpdir}/I_file}
-process p1 "exec varnishd -n ${tmpdir}/v1 -F -f '' -a :0 -l2m,1m -I ${tmpdir}/I_file 2>&1" -start
+process p1 "exec varnishd -n ${tmpdir}/v1 -F -f '' -a :0 -l2m -I ${tmpdir}/I_file 2>&1" -start
 
-process p1 -expect-text 0 0 {Warning: Ignoring deprecated second subargument to -l}
 process p1 -expect-text 0 1 {PONG}
 process p1 -expect-text 0 1 {END of -I file processing}
 
@@ -179,12 +160,12 @@ varnish v2 -stop -wait
 # Test multiple -f options with a bad VCL
 
 shell -err -expect {Cannot read -f file} {
-	exec varnishd -n ${tmpdir}/v0 -F -a :0 -l2m,3m -f ${tmpdir}/ok1 \
+	exec varnishd -n ${tmpdir}/v0 -F -a :0 -l2m -f ${tmpdir}/ok1 \
 	    -f ${tmpdir}/ok2 -f ${tmpdir}/bad
 }
 
 shell -err -expect {Cannot read -f file} {
-	exec varnishd -n ${tmpdir}/v0 -F -a :0 -l2m,3m -f ${tmpdir}/ok1 \
+	exec varnishd -n ${tmpdir}/v0 -F -a :0 -l2m -f ${tmpdir}/ok1 \
 	    -f ${tmpdir}/bad -f ${tmpdir}/ok2
 }
 


More information about the varnish-commit mailing list