Commit 69a3615e authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

r33742@cat (orig r1221): des | 2006-11-08 09:59:20 +0100

 Rewrite tackle_warg(): don't override the default max or timeout unless
 the user asks; bail if max < min; fix usage string.


git-svn-id: http://www.varnish-cache.org/svn/branches/1.0@1245 d4fa192b-c00b-0410-8231-f00ffab90ce4
parents 71fc1463 1457a239
......@@ -194,7 +194,7 @@ usage(void)
fprintf(stderr, " %-28s # %s\n", "",
" -w min,max");
fprintf(stderr, " %-28s # %s\n", "",
" -w min,max,timeout [default: -w1,INF,10]");
" -w min,max,timeout [default: -w1,1000,120]");
#if 0
-c clusterid@cluster_controller
-m memory_limit
......@@ -211,21 +211,23 @@ usage(void)
static void
tackle_warg(const char *argv)
{
int i;
unsigned ua, ub, uc;
unsigned int ua, ub, uc;
i = sscanf(argv, "%u,%u,%u", &ua, &ub, &uc);
if (i == 0)
usage();
if (ua < 1)
usage();
params->wthread_min = ua;
params->wthread_max = ua;
params->wthread_timeout = 10;
if (i >= 2)
params->wthread_max = ub;
if (i >= 3)
switch (sscanf(argv, "%u,%u,%u", &ua, &ub, &uc)) {
case 3:
params->wthread_timeout = uc;
case 2:
if (ub < ua)
usage();
params->wthread_max = ub;
case 1:
if (ua < 1)
usage();
params->wthread_min = ua;
break;
default:
usage();
}
}
/*--------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment