[master] 7175bb3 Remove the -w argument, -p should be used instead.

Poul-Henning Kamp phk at varnish-cache.org
Mon Apr 16 12:21:14 CEST 2012


commit 7175bb38e9f8ea5df2daf3725b9d624ef81cface
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Apr 16 10:20:55 2012 +0000

    Remove the -w argument, -p should be used instead.

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 97ac5da..7047fa9 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -100,20 +100,6 @@ pick(const struct choice *cp, const char *which, const char *kind)
 
 /*--------------------------------------------------------------------*/
 
-static unsigned long
-arg_ul(const char *p)
-{
-	char *q;
-	unsigned long ul;
-
-	ul = strtoul(p, &q, 0);
-	if (*q != '\0')
-		ARGV_ERR("Invalid number: \"%s\"\n", p);
-	return (ul);
-}
-
-/*--------------------------------------------------------------------*/
-
 static void
 usage(void)
 {
@@ -160,52 +146,11 @@ usage(void)
 	fprintf(stderr, FMT, "-T address:port",
 	    "Telnet listen address and port");
 	fprintf(stderr, FMT, "-V", "version");
-	fprintf(stderr, FMT, "-w int[,int[,int]]", "Number of worker threads");
-	fprintf(stderr, FMT, "", "  -w <fixed_count>");
-	fprintf(stderr, FMT, "", "  -w min,max");
-	fprintf(stderr, FMT, "", "  -w min,max,timeout [default: -w2,500,300]");
 	fprintf(stderr, FMT, "-u user", "Priviledge separation user id");
 #undef FMT
 	exit(1);
 }
 
-
-/*--------------------------------------------------------------------*/
-
-static void
-tackle_warg(const char *argv)
-{
-	char **av;
-	unsigned int u;
-
-	av = VAV_Parse(argv, NULL, ARGV_COMMA);
-	AN(av);
-
-	if (av[0] != NULL)
-		ARGV_ERR("%s\n", av[0]);
-
-	if (av[1] == NULL)
-		usage();
-
-	u = arg_ul(av[1]);
-	if (u < 1)
-		usage();
-	mgt_param.wthread_max = mgt_param.wthread_min = u;
-
-	if (av[2] != NULL) {
-		u = arg_ul(av[2]);
-		if (u < mgt_param.wthread_min)
-			usage();
-		mgt_param.wthread_max = u;
-
-		if (av[3] != NULL) {
-			u = arg_ul(av[3]);
-			mgt_param.wthread_timeout = u;
-		}
-	}
-	VAV_Free(av);
-}
-
 /*--------------------------------------------------------------------*/
 
 static void
@@ -516,8 +461,7 @@ main(int argc, char * const *argv)
 			usage();
 			break;
 		case 'w':
-			tackle_warg(optarg);
-			break;
+			ARGV_ERR("-w has been removed, use -p instead\n");
 		default:
 			usage();
 		}
diff --git a/bin/varnishtest/tests/v00006.vtc b/bin/varnishtest/tests/v00006.vtc
index f3faace..ca4c827 100644
--- a/bin/varnishtest/tests/v00006.vtc
+++ b/bin/varnishtest/tests/v00006.vtc
@@ -8,7 +8,7 @@ server s1 {
 } -start
 
 # Only one pool, to avoid getting more than one work thread
-varnish v1 -arg "-p thread_pools=1 -w1,1,300" -vcl+backend {
+varnish v1 -arg "-p thread_pools=1" -vcl+backend {
 } -start
 
 client c1 {



More information about the varnish-commit mailing list